Ajax surface panel update from another form

I have the code here:

<f:view> <h:form id="formA"> <p:treeTable id="tree"> <p:ajax event="select" listener="..." update="mustRefresh" /> ... </p:treeTable> </h:form> <h:form id="formB"> <p:panel id="mustRefresh"> ... </p:panel> </h:form> </f:view> 

When the user selects an entry in treeTable (formA), its detail will be displayed on form B and is ready for editing. My problem: update = "mustRefresh" does not work, it throws an exception as follows:

 javax.faces.FacesException: Cannot find component with identifier "mustRefresh" referenced from "A4578:formA:tree". 

I tried with @form, formB ,: formB and: mustRefresh, but it does not work.

+4
source share
2 answers

Since mustRefresh in the component hierarchy is inside formB , you must reference it with:

 <p:ajax event="select" listener="..." update=":formB:mustRefresh" /> 

See how UIComponentBase.findComponent works.

+21
source

Use update="@([id$=mustRefresh])" - this will directly display displayPost. There is no need to compare it with anything.

+6
source

All Articles