Thursday, 15 August 2013

primefaces - Referencing dataTable footer -



primefaces - Referencing dataTable footer -

i trying utilize ajax updates triggered component within p:datatable update footer of table. no matter how write id references in p:ajax tag don't seem able them right.

this example:

class="lang-html prettyprint-override"><h:form id="formid"> <p:datatable id="tableid" var="row" value="#{testbean.datarows}" rowindexvar="rowix"> <p:column> <h:outputtext value="#{row}"/> <p:inputtext id="innerinputid" value="#{testbean.str}"> <p:ajax event="keyup" update="tableid:footerid"/> <p:ajax event="keyup" update=":formid:tableid:footerid"/> <p:ajax event="keyup" update="@form:tableid:footerid"/> </p:inputtext> <f:facet name="footer"> <h:outputtext id="footerid" value="#{testbean.str}"/> </f:facet> </p:column> </p:datatable> <p:inputtext id="outerinputid" value="#{testbean.str}"> <p:ajax event="keyup" update="tableid:footerid"/> </p:inputtext> </h:form>

in generated html can see outputtext in footer gets id formid:tableid:footerid.

the reference outerinputid works fine.

all of references innerinputid expect work, don't. in generated html can see translated form formid:tableid:0:footerid. create sense if footer located within naming container of current row, isn't can see id.

i smell bug here. right? how can work around it?

or expected behaviour, , in case why?

i want display sum of cells in column in footer.

relevant software: primefaces 5.1, mojarra 2.2.7, glassfish 4.1

primefaces facelets jsf-2.2

No comments:

Post a Comment