a4j:jsFunction actionListener not listening
The listener is:
public void renderer(ActionEvent event) {
System.out.println("here=========================");
System.out.println();
System.out.println();
System.out.println();
System.out.printl开发者_如何学Pythonn();
System.out.println();
System.out.println();
System.out.println();
System.out.println();
System.out.println();
System.out.println();
System.out.println();
System.out.println();
setOptimizeActionDTOs(null);
}
and setOptimizeActionDTOs
public void setOptimizeActionDTOs(List<OptimizeActionDTO> optimizeActionDTOs) {
this.optimizeActionDTOs = optimizeActionDTOs;
}
And the a4j:jsFunction is:
<a4j:form>
<a4j:jsFunction name="renderOptimizeActionList" actionListener="#{rtopHandler.renderer}" oncomplete="renderOptimizeActionList1();"/>
<a4j:jsFunction name="renderOptimizeActionList1" reRender="profilealertpanel1"></a4j:jsFunction>
<script language="JavaScript">
renderOptimizeActionList();
</script>
</a4j:form>
But I can't see any output of the System.out
. Why? Any information will be very helpful to me.
Thank you.
Try putting your <script>
tags outside the <form>
tags.
Further, you can check whether the <a4j:jsFunction>
is called by putting an "alert()" on onbegin event of the <a4j:jsFunction/>
精彩评论