I use Primefaces 3.1, JSF 2.1.6 on Glassfish 3.1.1.
I have loads of commandbuttons which work fine, but this one doesn't and I can't figure out why. The javascript alert fires but the controller method is never called.
Note that the first commandbutton fires perfectly (the Filter button) but the edit button inside the datatable does not fire. Instead of a dataGrid I tried ui:repeat but this gives the same effect/issue. I have a lot of other datatables with a commandbutton but they all work fine...strange.
<h:form id="memberships" prependId="false">
<h:panelGrid columns="3">
<h:outputLabel value="Filter on EPS" />
<p:selectOneMenu value="#{epsMembershipViewController.selectedEps}"
style="width:200px" effect="fold" editable="false" id="selectEps">
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItems value="#{epsMembershipViewController.allEps}" />
</p:selectOneMenu>
<p:commandButton value="Filter"
action="#{epsMembershipViewController.repopulateView}" ajax="false" />
</h:panelGrid>
<br />
<p:dataGrid var="eps" value="#{epsMembershipViewController.ldapEpss}"
columns="1">
<h:outputLabel value="#{eps}"
style="font-weight: bold;font-size: 14px;" />
<p:dataTable var="ldapUser" id="id_#{eps}"
value="#{epsMembershipViewController.getUsersByEpsFromLdap(eps)}"
paginator="false" selectionMode="single" rowKey="#{ldapUser.name}"
rowStyleClass="#{ldapUser.expired == 'Yes' ? 'expired' : null}">
....... columns
<p:column style="width:20px">
<f:facet name="header">
<h:outputText value="" />
</f:facet>
<p:commandButton icon="ui-icon-extlink"
onclick="alert('this event does not work')" ajax="false"
action="#{epsMembershipViewController.edit()}" />
</p:column>
</p:dataTable>
<br />
<br />
</p:dataGrid>
</h:form>
Bean code
public String edit(ActionEvent e) {
log.debug("EDIT USER 22222 ");
return "eps-search";
}
Thanks for your help, Coen