以下是我在复选框上使用的 ajax
<h:panelGrid columns="2" style="width: 100%" columnClasses="eighty-percent top-alignment, twenty-percent top-alignment">
<p:panel id="checkBoxNameOnePannel" styleClass="noBorderPanel">
<h:selectBooleanCheckbox id="checkBoxNameOne" value="#{formIllinoisStateW4Controller.checkBoxNameOne}" >
<p:ajax event="change" execute="@this" listener="#{formIllinoisStateW4Controller.handleEvent}" update="formName:elementOne formName:elementTwo"/>
</h:selectBooleanCheckbox>
<p:outputLabel value="#{msgs['pro.form.illinois.statew4.step1.paragraph1']}" escape="false"/>
</p:panel>
</h:panelGrid>
这是我在 jsf 控制器中的方法处理程序
public void handleEvent(AjaxBehaviorEvent event) {......}
但它没有按预期工作,它像
当我单击第一个复选框时,该事件不会被触发,但是当我单击第二个元素时,事件会被触发,并且我获得了第一次单击元素的值,而我应该获得第二个元素的值。
我无法找到问题,有人可以帮助我,因为我在这里犯了什么错误?