The best place to *find* answers to programming/development questions, imo, however it's the *worst* place to *ask* questions (if your first question/comment doesn't get any up-rating/response, then u can't ask anymore questions--ridiculously unrealistic), but again, a great reference for *finding* answers.

My Music (Nickleus)

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.

No comments:

Post a Comment