Take the 2-minute tour ×

I have 2 pages


                <h:outputText value="Name : "/>
                <p:inputText id="name" value="#{inputBean.name}"/>
            <p:column colspan="2" >
                <p:commandButton action="#{inputBean.buttonAction}" value="Submit"/>


<h:form id="form1">
    <h:outputText value="#{inputBean.name}" id="dis123"/>

If I include both of them in a single page like below


<p:accordionPanel widgetVar="main" multiple="true">
    <p:tab title="Input">
        <ui:include src="input.xhtml"/>

    <p:tab title="Output">
        <ui:include src="display.xhtml"/>

can I call update="dis123" from command button in input.xhtml?

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

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.

See also:

share|improve this answer
add comment

Your Answer


