I call the method by clicking the link. The following code works ajaxfully
<ui:repeat value="#{myBean.names}" var="name" varStatus="idx"> <li> <h:commandLink value="#{name.label}"> <f:ajax execute="@this" event="click" render="@all" listener="#{myBean.changeActiveName}" > </f:ajax> </h:commandLink> </li> </ui:repeat>
But when I try to pass the parameter to an Ajax call, it starts to refresh the whole page
<ui:repeat value="#{myBean.names}" var="name" varStatus="idx"> <li> <h:commandLink value="#{name.label}"> <f:ajax execute="@this" event="click" render="@all" listener="#{myBean.changeActiveName}" > <f:param name="idx" value="#{idx}" /> </f:ajax> </h:commandLink> </li> </ui:repeat>
What is wrong with this code?
source share