I'm using PrimeFaces and a component within one layoutUnit
must update another component which is within another layoutUnit
:
<p:layout>
<p:layoutUnit position="west" size="275" resizable="true" closable="true" collapsible="true">
<h:form id="formWest">
<div id="west">
<ui:insert name="west"></ui:insert>
</div>
</h:form>
</p:layoutUnit>
<p:layoutUnit id="layout_center" position="center">
<h:form id="formCenter">
<div id="content">
<ui:insert name="content"></ui:insert>
</div>
</h:form>
</p:layoutUnit>
</p:layout>
The error message is: Caused by: javax.faces.FacesException: Cannot find component with expression "formWest:execucao" referenced from "formCenter:form:mapaGoogle".
The components that need to be updated are inside td
so I did <td jsf:id="execucao">
, for example.
As you know when you refer components from another form you have to attach the form ID to the component Id.
You also need to know that you have to attach another :
before the form ID, when refereing the compnent in different form.
Example:
<h:form id="form1">
<p:inputText id="input1" />
</h:form>
Now if I want to update the input1
from another form I have to use:
:form1:input1
Example:
<h:form id="form2">
<p:commandButton update=":form1:input1" />
</h:form>
In your case use:
:formWest:execucao
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With