This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JSF and the fly likes Ajax listener method is not fire for other(except first) component Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Ajax listener method is not fire for other(except first) component" Watch "Ajax listener method is not fire for other(except first) component" New topic
Author

Ajax listener method is not fire for other(except first) component

Milan Mendpara
Greenhorn

Joined: May 10, 2011
Posts: 7

hi !

i've set pagination in ajax with four command button like first,next,previous,last.
it works fine for the first(any among four) button that i have pressed ....... all the subsequent click on that button , ajax listener method is fired ...
but other button's listener method is not fired then onwards

<h:form >
<h:datatable id=myDatatable >
// some code
</h:datatable>
<h:commandButton id="btnFirst" value="First" >
<f:ajax execute="@form" event="action" render="myDatatable hdnPage" listener="#{zoneBean.first}" />
</h:commandButton>
<h:commandButton id="btnPrevious" value="Previous" >
<f:ajax execute="@form" event="action" render="myDatatable hdnPage" listener="#{zoneBean.previous}"/>
</h:commandButton>
<h:commandButton id="btnNext" value="Next" >
<f:ajax execute="@form" event="action" render="myDatatable hdnPage" listener="#{zoneBean.next} />
</h:commandButton>
<h:commandButton id="btnLast" value="Last" >
<f:ajax execute="@form" event="action" render="myDatatable hdnPage" listener="#{zoneBean.last}" />
</h:commandButton>

<h:inputHidden id="hdnPage" value="#{zoneBean.page}" />
</h:form>

// sample of managed bin

// bean scope : requestScope

public void next(AjaxBehaviourEvent e) {
page+=1;
zoneList = port.getAllZones().subList(page * pageRows, page * pageRows + pageRows);
}

i hope you understand my problem .. . so any idea how can i call more than one listener method for the JSF components ?

thanks in advance !!!

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Ajax listener method is not fire for other(except first) component