myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick>
Subject Re: understanding the impact of 'rendered'
Date Fri, 09 Sep 2005 22:14:20 GMT
CONNER, BRENDAN (SBCSI) wrote the following on 9/9/2005 5:03 PM:
> I think the key here is that the rendered condition is checked *after*
> the button has been clicked, and, if you haven't saved the state of the
> bean that contains the boolean value, it will get re-initialized with
> null values (and false values) when it is referenced and the decision is
> made to create the action button component.

Yes. Agreed that is what is happening. I'm curious, however, to learn 
*why* this is the behavior (checking the rendered condition after the 
click) for actions on buttons. The recommended way to decide whether to 
display a button or not seems to be to use the 'rendered' condition, yet 
now you also have to remember to save the state.

I have a serious question, if you didn't have MyFaces "saveState" how in 
the world would one deal with this? I wouldn't want to be forced to give 
my whole backing bean session scope just to be able to hide or show a 
button on a form based on some condition.

I'll have to add this to the wiki. I'm sure someone else is going to get 
burned on this 'rendered' behavior.

Thanks for all your help (and patience:) Mike and Brendan. You've kept 
me somewhat sane throughout this learning process.


View raw message