This content has been marked as final.
Show 3 replies
-
1. Re: rich:component returns the component with the same id in
nbelaevski Dec 29, 2008 7:03 AM (in response to liuliu)Hello Liu,
Functions (rich:component(), rich:element(), rich:clientId()) are contextless in JSF, there's no way to know from what component they're called, so searching is done starting from view root and the first matching component is always used. Absolute path: :formName:componentName should solve the problem. -
2. Re: rich:component returns the component with the same id in
liuliu Dec 29, 2008 11:39 AM (in response to liuliu)thanks
for absolute path, you want to write "formName:componentName" not ":formName:componentName" -
3. Re: rich:component returns the component with the same id in
nbelaevski Dec 29, 2008 2:05 PM (in response to liuliu)Both variants will work. 'formName:componentName' is relative path though, consider the following example:
<f:subview id="subview1"> <a4j:form id="form"> <rich:panel id="panel"> Panel </rich:panel> <rich:panel id="panel2"> Panel 2 </rich:panel> </a4j:form> </f:subview> <f:subview id="subview"> <a4j:form id="form"> <rich:panel id="panel"> Panel </rich:panel> <rich:panel id="panel2"> Panel 2 </rich:panel> </a4j:form> </f:subview> <h:outputText value="#{rich:clientId('form:panel')}" /><br /> <h:outputText value="#{rich:clientId(':subview:form:panel')}" />