ı在控制台中没有收到任何警告或错误消息。调试模式断点在bean类的valueChangeListener方法中不起作用。另一种方法在bean类的调试模式下工作。 ı还试着听听ajax。(我正在使用maven)有人有想法吗?
xhtml文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:b="http://bootsfaces.net/ui"
xmlns:p="http://primefaces.org/ui"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:body>
<ui:composition template="/template/template.xhtml">
<ui:define name="menu">
<ui:include src="/template/menu.xhtml">
<ui:param name="menuId" value="4"></ui:param>
</ui:include>
</ui:define>
<ui:define name="content">
<ui:include src="../template/progress.xhtml"></ui:include>
<h:form id="nameForm">
<h:outputScript library="primefaces" name="jquery/jquery.js"
/>
<b:column col-xs="12" col-md="8">
<b:panel style="width:80%">
<b:panelGrid colSpans="4,8">
<p:tabView id="tabView" style="min-width:450px;" >
<p:tab title="..." >
<b:panelGrid colSpans="3,9" columns="2"
cellpadding="10">
<p:selectOneMenu value="#{beanController.a}"
id="AId"
valueChangeListener="#{beanController.aSelected}" onchange="submit()">
<p:ajax event="change"/>
<f:selectItems
value="#{beanController.aList}" />
</p:selectOneMenu>
</b:panelGrid>
</p:tab>
beanController.java:
@ManagedBean(name = "beanController")
@ViewScoped
public class BeanController {
public void aSelected(ValueChangeEvent event){
答案 0 :(得分:0)
You can use <f:ajax />, like that :
<f:ajax event="blur" listener="#{beanController.updateDataListener}" update=":#{p:component('tabView')}"/>
@ManagedBean(name = "beanController")
@SessionScoped
public class BeanController implements Serializable{
private String a;
public void updateDataListener(AjaxBehaviorEvent event)
{
......
}
}