Navigation must be more than request-scoped for rendered to work.
A quick test is to make that bean session-scoped. Generally, a
better fix is to use t:saveState
value="#{navigation.tabNavigationAllowed}"
I don't think the c tags will work since they only execute once on page build.
On 9/21/06, K. Johnson <[EMAIL PROTECTED]> wrote:
We are using facelets. i have have tried it a couple different ways, but here
is a snippet with Jstl c:if and below it a snippet with rendered. When the page
is first rendered the navbars display or hide correctly. When I come back to
the page, even if the bean value is changed the components don't update:
<c:if test ="#{navigation.tabNavigationAllowed}">
<ul>
<c:set var="billingCenter" value="#{lbls.billingAction}" />
<c:choose>
<c:when test="#{tabSelected == 'billingCenter'}">
<li class="firstselected">
<a tabindex="1" jsfc="h:commandLink" value="#{lbls.billingLabel}"
actionListener="#{navigation.generalAction}" action="#{navigation.getAction}" immediate="${immediate}"
id="#{lbls.billingAction}" ></a>
</li>
</c:when>
<c:otherwise>
<li>
<a jsfc="h:commandLink" value="#{lbls.billingLabel}"
actionListener="#{navigation.generalAction}" action="#{navigation.getAction}" immediate="${immediate}"
id="#{lbls.billingAction}" ></a>
</li>
</c:otherwise>
</c:choose>
</c:if>
<h:outputText rendered="#{navigation.tabNavigationAllowed}">
<li class="firstselected">
<a tabindex="1" jsfc="h:commandLink" value="#{lbls.billingLabel}" actionListener="{navigation.generalAction}"
action="#{navigation.getAction}" immediate="${immediate}" id="#{lbls.billingAction}"></a>
</li>
</h:outputText>
Thanks!
> -------Original Message-------
> From: Gert Vanthienen <[EMAIL PROTECTED]>
> Subject: Re: Re-render JSF page components
> Sent: 21 Sep '06 18:58
>
> L.S.,
>
> I have never encountered any problems when using the rendered attribute
> for implementing this kind of behavior.Could you post a snippet of the
> JSP page code you're using?
>
> Regards,
>
> Gert Vanthienen
> [EMAIL PROTECTED]
>
>
>
> K. Johnson wrote:
> > I have some components on my JSF page that need to display or hide based
on a bean boolean property.
> >
> > I have tried using the rendered attribute as well as jstlc:if and
c:choose. My page displays properly the first time based on the condition, but if i
go through a JSF lifecycle and return to the same page, even though the bean boolean
value has changed, and displays correctly as a string, the previously rendered or
hidden components don't update?
> >
> > Is there a trick to get this to work?
> >
> >
> > Thank you!
> >
> >
> >
> >
> >>-------Original Message-------
> >>From: [EMAIL PROTECTED]
> >>Subject: RE: Refresh JSF Page
> >>Sent: 21 Sep '06 13:35
> >>
> >>
> >>Thanks Jeff,
> >>
> >>I will try the option suggested by you.
> >>Here are some more details about my requirement.
> >>Every page of my application has header. Header contains Refresh button.
> >>Selecting it, the page should fetch the data from back end.
> >>
> >>I foresee some problems with Refresh in JSF with the limited knowledge I
> >>have in JSF.
> >>- The page would have been displayed because of some actionlistener with
> >>parameters.
> >>Getting the parameters again (firing of that actionlistener) may not be
> >>possible.
> >>- the Browser URL may be that of previous page (Using 'redirect' in
> >>faces-config may solve this. But I'm not sure about the implications of
> >>it)
> >>
> >>I hope the trick would work for me.
> >>
> >>Regards,
> >>Kiran
> >>
> >>-----Original Message-----
> >>From: Jeff Bischoff [mailto:[EMAIL PROTECTED]
> >>Sent: Thursday, September 21, 2006 12:07 AM
> >>To: MyFaces Discussion
> >>Subject: Re: Refresh JSF Page
> >>
> >>
> >>Kiran,
> >>
> >>That's a pretty broad topic! If you could be more specific, you might
> >>get more hints...
> >>
> >>See [1] for a neat trick to force updated model values in input
> >>components.
> >>
> >>[1] http://wiki.apache.org/myfaces/ClearInputComponents
> >>
> >>Regards,
> >>
> >>Jeff Bischoff
> >>Kenneth L Kurz & Associates, Inc.
> >>
> >>[EMAIL PROTECTED] wrote:
> >>> Hi,
> >>>
> >>> I have to provide Refresh Button in all the pages of my JSF
> >>application.
> >>> Please help me how to achieve Refresh.
> >>>
> >>> Regards,
> >>> Kiran
> >>>
> >>> The information contained in this electronic message and any
> >>attachments
> >>> to this message are intended for the exclusive use of the addressee(s)
> >>
> >>> and may contain proprietary, confidential or privileged information.
> >>If
> >>> you are not the intended recipient, you should not disseminate,
> >>> distribute or copy this e-mail. Please notify the sender immediately
> >>and
> >>> destroy all copies of this message and any attachments.
> >>>
> >>> WARNING: Computer viruses can be transmitted via email. The recipient
> >>> should check this email and any attachments for the presence of
> >>viruses.
> >>> The company accepts no liability for any damage caused by any virus
> >>> transmitted by this email.
> >>>
> >>> www.wipro.com
> >>>
> >>
> >>
> >>
> >>
> >>The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s) and may contain
proprietary, confidential or privileged information. If you are not the intended
recipient, you should not disseminate, distribute or copy this e-mail. Please notify the
sender immediately and destroy all copies of this message and any attachments.
> >>
> >>WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses. The company
accepts no liability for any damage caused by any virus transmitted by this email.
> >>
> >>www.wipro.com
> >>
> >>
> >
> >
> >
>
>