jsf - How to update panel from datatable -


commandbutton id("mybuttonid2") works fine. mean updates "myoutputpanel" commandbutton inside datatable doesn't update outputpanel. there specific update style datatables?

<h:form id="myform" prependid="false">   <p:panel id="mypanel">      <p:datatable id="mydatatable">         <p:column style="width:4%">             <p:commandbutton id="mybuttonid" update="myoutputpanel"/>         </p:column>      </p:datatable>      <p:commandbutton id="mybuttonid2" update="myoutputpanel"/>     </p:panel>   <p:outputpanel id="myoutputpanel">   //some stuff  </p:outputpanel> 

this because process , update work same way f:ajax component attributes execute , render do. 1 can reference id of component directly if reside within same namingcontainer.

the clientid generated prefixing naming container ids seperated : default. p:panel component not implement namingcontainer although h:form , p:datatable implement namingcontainer.

the clientid of myoutputpanel follows:

myform:myoutputpanel 

the second button works because outside of datatable , relative myoutputpanel in same namingcontainer form. reference absolute clientid in process or update 1 can prefix clientid : symbol.

try changing update attribute of first commandbutton to:

:myform:myoutputpanel 

this should allow absolutely reference generated clientid , work.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -