-
1. Re: Generated id of the components included in multiple page
yyq2009 Aug 12, 2009 10:39 PM (in response to leelavathic)Hi, I think script part is static, it is rendered once and doesn't change any more, so you only see the same string on the alert window.
What confused me is that the first fragement's attribute "rendered" set to false, it is still not change, maybe the page rendered on the server side following an order.
Can anyone guide me? -
2. Re: Generated id of the components included in multiple page
yyq2009 Aug 12, 2009 10:45 PM (in response to leelavathic)I've forgotten something.
Replacing <ui:fragment> with <c:if test="showornot">, it may be ok.
if test="false", the jsf engine will skip the childrend of it. -
3. Re: Generated id of the components included in multiple page
leelavathic Aug 13, 2009 12:46 AM (in response to leelavathic)I don't want to mix up jstl and richfaces.
Is there any other way of generating the ids depending on the page which includes the component. -
4. Re: Generated id of the components included in multiple page
liuliu Aug 13, 2009 3:34 AM (in response to leelavathic)why i cant find rendered attribute on <ui:fragment> in the doc of facelet? is it the problem?
-
5. Re: Generated id of the components included in multiple page
leelavathic Aug 13, 2009 4:10 AM (in response to leelavathic)Even I could not find any documentation regarding rendered attribute of ui:fragment.
I tried even using rich:tabPanel instead of ui:fragment, but still the issue remains
main.xhtml<rich:tabPanel rendered="#{frameMgdBean.type=='frame1'}" > <rich:tab> <a4j:include id="frame1page" viewId="/websites/frame1.xhtml"/> </rich:tab> </rich:tabPanel> <rich:tabPanel rendered="#{frameMgdBean.type=='frame2'}" > <rich:tab> <a4j:include id="frame1page" viewId="/websites/frame2.xhtml"/> </rich:tab> </rich:tabPanel>
-
6. Re: Generated id of the components included in multiple page
yyq2009 Aug 13, 2009 9:00 PM (in response to leelavathic)Hi, how about this?
<a4j:include viewId="/#{frameMgdBean.type=='frame1'?'websites/frame1.xhtml':'websites/frame2.xhtml'}"/>
don't test it. -
7. Re: Generated id of the components included in multiple page
liuliu Aug 14, 2009 3:38 AM (in response to leelavathic)
maybe it is problem of rich:clientId. after my test, it is the function in the second page included is called. -
8. Re: Generated id of the components included in multiple page
nbelaevski Aug 14, 2009 6:10 AM (in response to leelavathic)rich:clientId searches the nearest context first and does this independently on whether target component is rendered now or not. You can qualify id manually like this:
frame2page:currentDate