I want to create a composite componet that can iterate with others. The problem is that composite componet is a namingcontainer and a simple selectOnMenu change and refresh other selectOnMenu do not is possible because "id" given to selectOnMenu is combo1:combo
and can't see combo2:combo
.
The best situation would be form1:combo1
and form1:combo2
, then, combo1 and combo2 uses uinamingcontainer of h:form
.
This link talks about this but no solution.
https://cwiki.apache.org/MYFACES/create-a-non-namingcontainer-composite-component.html
Another try but don't works. p:commandbutton
can't see id of div inside of CC.
Obtaining the clientId of the parent of a JSF2 composite component
<p:commandButton value="asd" partialSubmit="true" process="@this" update="fooId"/>
<cf:label id="fooId" title="xxxxx" />[index.xhtml]
<composite:interface componentType="RootComponent" preferred="false">
<composite:attribute name="title" />
</composite:interface>
<composite:implementation>
<div id="#{cc.immediateParent.clientId}:#{cc.id}">
#{currentDate}
<h:panelGroup id="#{cc.clientId}" layout="block">
<p:outputLabel id="#{cc.clientId}_lb" value="#{cc.attrs.title}">
<composite:insertChildren />
</p:outputLabel>
</h:panelGroup>
</div>
</composite:implementation>[label.xhtml](compositecomponent)