0
我有一个按钮。如果这被按下,应该呈现一个复选框。
这当然工作得很好。该复选框应该,当改变时调用一个函数,这应该只是System.out.println()
东西,所以我看到它的调用。
问题是:只是简单的复选框功能,没有渲染效果很好。但一旦a4j:support
重新显示,它不工作,System.out.println()
永远不会被称为a4j:在reRender中的支持不起作用
这看起来很容易,但我不知道它为什么不工作!
任何暗示/诡计?
这是旧的环境,所以只有JSF 1.2。
我XHTML
<s:div id="sdBoolCheckboxtest">
#{testController.testRerenderBool}
<s:div id="sdRerender" rendered="#{testController.testRerenderBool}">
<h:selectBooleanCheckbox id="myscheckbox" value="#{testController.testBool}">
<a4j:support ajaxSingle="true" event="onclick" immediate="true"
status="globalStatus" action="#{testController.testCheckbox()}" />
</h:selectBooleanCheckbox>
</s:div>
</s:div>
</h:form>
我的Java类:
@Name("testController")
@AutoCreate
public class TestController {
private boolean testBool = false;
public boolean isTestRerenderBool() {
return testRerenderBool;
}
public void setTestRerenderBool(boolean testRerenderBool) {
this.testRerenderBool = testRerenderBool;
}
private boolean testRerenderBool;
public void switchtestRerenderBool(){
System.out.println("switch");
testRerenderBool = !testRerenderBool;
}
public void testCheckbox(){
System.out.println("drin");
}
public boolean isTestBool() {
return testBool;
}
public void setTestBool(boolean testBool) {
this.testBool = testBool;
}
}