I have 2 pages
input.xhtml
<h:form>
<p:panelGrid>
<p:row>
<p:column>
<h:outputText value="Name : "/>
</p:column>
<p:column>
<p:inputText id="name" value="#{inputBean.name}"/>
</p:column>
</p:row>
<p:row>
<p:column colspan="2" >
<p:commandButton action="#{inputBean.buttonAction}" value="Submit"/>
</p:column>
</p:row>
</p:panelGrid>
</h:form>
display.xhtml
<h:form id="form1">
<h:outputText value="#{inputBean.name}" id="dis123"/>
</h:form>
If I include both of them in a single page like below
index.xhtml
<p:accordionPanel widgetVar="main" multiple="true">
<p:tab title="Input">
<ui:include src="input.xhtml"/>
</p:tab>
<p:tab title="Output">
<ui:include src="display.xhtml"/>
</p:tab>
</p:accordionPanel>
can I call update="dis123"
from command button in input.xhtml
?
PrimeFaces AutoUpdate. In one of our PrimeFaces powered applications, we use a single growl component placed in a template of the application. All application wide messages are displayed using this growl so each page using the template does not need to define it every time. Problem is on every page we need to update this growl component for most...
PrimeFaces provides a partial page rendering ( PPR) and view-processing feature based on standard JSF 2 APIs to enable choosing what to process in the JSF lifecycle and what to render in the end with AJAX. PrimeFaces AJAX Framework is based on standard server-side APIs of JSF 2.
PrimeFaces AJAX Framework is based on standard server-side APIs of JSF 2. On the client side, rather than using the client-side API implementations of JSF implementations, such as Mojarra and MyFaces, PrimeFaces scripts are based on the jQuery JavaScript library.
On the client side, rather than using the client-side API implementations of JSF implementations, such as Mojarra and MyFaces, PrimeFaces scripts are based on the jQuery JavaScript library. How to do it...
No, you can't. A relative client ID like update="dis123"
basically searches in the same NamingContainer
parent component which is in your case the <h:form>
of the first page. However, no such component exist. It's actually in a different NamingContainer
parent. You need to provide an absolute client ID instead: update=":form1:dis123"
.
For starters, an easy way to figure the right absolute client ID is by just looking in the JSF-generated HTML output (rightclick, View Source in browser) for the generated HTML element ID of the desired component and then prefix it with :
.
Please note that this all has nothing to do with includes. You'd have had exactly the same problem when having all the code in a single page.
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