1
votes

launcher.xhtml

this form uses "thing"

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:composite="http://java.sun.com/jsf/composite"
      xmlns:f="http://java.sun.com/jsf/core"      
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:custom="http://java.sun.com/jsf/composite/components">
<h:form id="form">
<p:panelGrid 
id="pgid"
columns="2">
    <h:outputText value="title"/>
    <h:outputText value="#{bean.value}"/>   
</p:panelGrid>

<custom:thing 
via="#{bean.via1}"
viaListener="#{bean.via2Listener()}"        
vias="#{bean.vias1}">
</h:form>

thing.xhtml

<p:selectOneMenu                    
            process="@this"
            value="#{cc.attrs.via}">
                <p:ajax
                listener="#{cc.attrs.viaListener}"
                update="form:pgid"
                />
                <f:selectItems value="#{cc.attrs.vias}"/>
            </p:selectOneMenu>      

faces canĀ“t find form:pgid. tried with and without prepending "form". thanks

1

1 Answers

2
votes

Relative client IDs (those not starting with :) are searched relative to the parent NamingContainer component, which is in your case the composite component itself. So it's looking for form:pgid in the context of <cc:implementation>.

You need to prefix the client ID with : (the default NamingContainer separator character) to make it absolute to the view root.

<p:ajax ... update=":form:pgid" />

See also: