Hi Craig!
I think you don't mean the *value* attribute of the component tag, because as I know, this is not possible in my use case. The related backing-bean property won't be updated, since the update model values phase is skipped. The value entered is stored in the component (submitted or local value) only.
 
So what do you mean with "binding the *value* of the component to a session bean property"?


Regards,

Matthias
-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Im Auftrag von Craig McClanahan
Gesendet: Donnerstag, 22. Dezember 2005 19:23
An: MyFaces Discussion
Betreff: Re: Restore View question



On 12/22/05, Matthias Kahlau <[EMAIL PROTECTED]> wrote:
Hi!

Many thanks. Yes, I confused the term "page" with "site" in the late night.

> von Simon Kitching
> Gesendet: Donnerstag, 22. Dezember 2005 02:58
> There are exceptions to this, eg when a component has a binding to a
> bean of session scope. And the browser back-button can cause old cached
> component trees to be restored. However that's the exception not the
> typical behaviour.


I experienced an additional case where component-binding causes a different
behavior than without when a page is revisited after another page. I added
component-binding (using a session backing-bean) to my components because
the page with the component-binding components is left by the user to an
edit details page, and might be revisited after the user presses the cancel
or save button on the second page. When the user then revisits the first
page, the values of the components had to be retained, because they are not
saved in the model when the user leaves the page to edit the details (I
didn't want any validation to occur, that's why the validation phase/update
model phase is skipped).

With component-binding (and session backing-bean), it was possible that the
component values of the first page are retained (e. g. the text the user
entered in an inputText). So the component-binding components of the
component tree of the first view/page seem not to be discarded when the
component tree of the second view is created.

So, my question is: when are component-binding components, or at least,
their properties discarded? Does it only depend on the lifetime of the
related backing-bean or any explicit modifications of the components?

The lifetime of the backing bean controls how long such a component instance would be preserved.  However, for this use case, I would recommend binding the *value* of the component to a session bean property, rather than the component itself.  JSF will take care of the rest of the component state for you.

Regards,

Matthias

Craig

Reply via email to