You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jason Vincent <jt...@gmail.com> on 2006/08/30 22:33:32 UTC

[Shale] Old form values still there after "Cancel" button.

Hi all,

For the life of me I can't get JSF to stinkn forget values that were
entered on a form.
The view controller is "request" scope.

If I start to enter data in a form and then click the "Cancel" button,
which has immediate="true",  the values entered by the user reappear
in the form when I return to the page.  The action of the Cancel
button returns "home" which maps to a navigational rule to the home
page that is a "redirect".

I've tried these two things which haven't worked:

1) traverse the ViewRoot looking for UIInputs and setting the
submitted value to null.
2) set the value binding to the VC managed bean to null.  I had read
that JSF will reuse evaluated expressions if they aren't null.


Any help is greatly appreciated.
Jason

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [Shale] Old form values still there after "Cancel" button.

Posted by Craig McClanahan <cr...@apache.org>.
On 8/30/06, Jason Vincent <jt...@gmail.com> wrote:
>
> Hi all,
>
> For the life of me I can't get JSF to stinkn forget values that were
> entered on a form.
> The view controller is "request" scope.


Are you using Shale for this?  If so, you'd be best off joining the Shale
user list, as Shale is now it's own top level project.  See <
http://shale.apache.org/mail-lists.html> for  signup details.


If I start to enter data in a form and then click the "Cancel" button,
> which has immediate="true",  the values entered by the user reappear
> in the form when I return to the page.  The action of the Cancel
> button returns "home" which maps to a navigational rule to the home
> page that is a "redirect".
>
> I've tried these two things which haven't worked:
>
> 1) traverse the ViewRoot looking for UIInputs and setting the
> submitted value to null.
> 2) set the value binding to the VC managed bean to null.  I had read
> that JSF will reuse evaluated expressions if they aren't null.


Setting the cancel button's immediate property to "true" is the right
general behavior, because you want to bypass validation and model value
updates.  However, that should actually be irrelevant if you are redirecting
to the new page.  The only way I can think of that you should expect the
behavior you describe is if you have bound components on the page to a bean
that is in session scope, rather than request scope.

Any help is greatly appreciated.
> Jason
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Craig