users@glassfish.java.net

Re: Prevent eval of JSF rendered attributes from previous page on PostBack?

From: <glassfish_at_javadesktop.org>
Date: Thu, 12 Feb 2009 05:00:25 PST

I register just to post my solution:
In jsf Restore view phase, your request bean is not filled with info. This will happen in update model phase.
But your bean is not null. you can call a method on in.
create a public method which starts with "get" :
public Boolean getShouldIRenderThis(){
                if (FacesContext.getCurrentInstance().getRenderResponse()) {
//this Return true if the renderResponse() method has been called for the current request.
                          if( blabla... check value of your request bean variables
                               and return true or false)
            // render response is the final phase so your bean is filled with info. Update model has been done.
   } ELSE {
     return true;// i will render it. because i need it. it holds a bean info and i need it in invoke application phase.

I hope it's clear enuff
}
[Message sent by forum member 'danezu214' (danezu214)]

http://forums.java.net/jive/thread.jspa?messageID=331529