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;
}
}