[ 
http://issues.apache.org/jira/browse/MYFACES-268?page=comments#action_12312848 
] 

Konstantin Nikolaev commented on MYFACES-268:
---------------------------------------------

Thanks for response Martin.
The decision to re-read the backing bean works good.

I'd like to comment:
In my opinion, something wrong with MyFaces.
When you have an array of objects eg. users (users can be displayed in table on 
your page), and a form for editing these objects with Cancel button on it, it 
is quite natural to put immediate="true" inside your cancel commandButton(in 
order to escape all validators if you cancel changes). But immediate="true" 
causes the problem with values to be displayed in the inputTexts when you try 
to edit another object (you get values of the previous object in the 
inputTexts). I think MyFaces stores values somewhere inside (probably in 
submittedValues) and redisplay them. Removing immediate="true"  solves this 
problem, but without immediate="true" your cancel button is not a real cancel 
button any more, because validation will be taking place each time you hit it.

Does anyone have comments on this problem?

> inputText displays wrong value.
> -------------------------------
>
>          Key: MYFACES-268
>          URL: http://issues.apache.org/jira/browse/MYFACES-268
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>  Environment: WinXP, MyFaces 1.0.9 beta
>     Reporter: Konstantin Nikolaev
>     Assignee: Martin Marinschek

>
> In my project I have a form for editing a user profile. There are three 
> inputTexts (login, password, e-mail) and two commandButtons (Save profile, 
> Cancel) on it. When I change data in inputTexts and press "Save profile" my 
> application first saves a new data to the database and then navigates to a 
> form displaying a user profile with changes (It's OK).
> But if I change data in inputTexts and then decide to NOT save a new data I 
> press "Cancel" and simply navigate to a form displaying a user profile. But 
> profile displays with changes. This is not what expected. If I cancel changes 
> the form should display a profile with no changes.
> Does anyone have an idea how I can tune MyFaces to solve this problem?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to