File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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 !!!

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ajax listener method is not fire for other(except first) component