You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "K. Johnson" <in...@streetcookie.com> on 2006/09/21 20:52:02 UTC

Re-render JSF page components

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 jstl  c: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: kiran.gutta@wipro.com
>  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:jbischoff@klkurz.com]
>  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.
>  
>  kiran.gutta@wipro.com 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
>  

Re: Re-render JSF page components

Posted by Gert Vanthienen <ge...@skynet.be>.
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
gert@anova.be



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 jstl  c: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: kiran.gutta@wipro.com
>>  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:jbischoff@klkurz.com]
>>  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.
>>  
>>  kiran.gutta@wipro.com 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
>>  
>>     
>
>
>