IT, computer and programming tutorials and tips that i couldnt find anywhere else using google, from my daily work as a Senior Developer of solutions using Java and Linux.
20140320
primefaces p:commandLink oncomplete attribute referencing non-existent ID was messing up table filter and sort functions
i had this primefaces delete-icon code in a table row:
<p:commandLink id="deletelink" title="#{msg['label.delete']}"
action="#{ta_mappingObject.setCurrentItemAndPanelToShow(agreement, 'deleteTA')}"
rendered="#{!ta_mappingObject.createFromRequestDetails and userMenuBean.canEditAgreement()}"
oncomplete="PF('confDeleteAgreement').show();">
<h:graphicImage value="/images/icons/delete.gif" style="border:0" />
</p:commandLink>
and stuff on the page like filtering and sorting wasn't working, so i figured out that because that link was referencing a dialog ID that didn't exist, it was messing up the whole page, so i changed it to this:
<p:commandLink id="deletelink" title="#{msg['label.delete']}"
action="#{ta_mappingObject.setCurrentItemAndPanelToShow(agreement, 'deleteTA')}"
rendered="#{!ta_mappingObject.createFromRequestDetails and userMenuBean.canEditAgreement()}"
oncomplete="PF('andIdThatExists').show();">
<h:graphicImage value="/images/icons/delete.gif" style="border:0" />
</p:commandLink>
and everything started working again.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment