You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Konstantin Nikolaev (JIRA)" <my...@incubator.apache.org> on 2005/06/02 16:04:58 UTC

[jira] Created: (MYFACES-268) inputText displays wrong value.

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


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


[jira] Commented: (MYFACES-268) inputText displays wrong value.

Posted by "Martin Marinschek (JIRA)" <my...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-268?page=comments#action_12316861 ] 

Martin Marinschek commented on MYFACES-268:
-------------------------------------------

Sorry for taking so long - a final comment - you need to determine what will be shown in your detail page by determining the state of  your managed beans, this is not a problem with MyFaces.

You need to take some action on the cancel button to clean out the detail data, so that upon entering again into the detail page the detail data will be read again, now with the correct id.

regards,

Martin



> 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
>      Fix For: Nightly Build

>
> 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


[jira] Commented: (MYFACES-268) inputText displays wrong value.

Posted by "Martin Marinschek (JIRA)" <my...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-268?page=comments#action_12312905 ] 

Martin Marinschek commented on MYFACES-268:
-------------------------------------------

I still don't understand what you are trying to achieve.

If you cancel your data and go back to your list, how come that you have old values in your edit-fields?

What you are describing to me is exactly what JavaServerFaces is about - it does state-saving for you, and your beans are kept filled with your data as long as you need them. If you want to remove data, you explicitly need to delete it.

regards,

Martin

> 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


[jira] Commented: (MYFACES-268) inputText displays wrong value.

Posted by "Bruno Aranda (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-268?page=comments#action_66860 ]
     
Bruno Aranda commented on MYFACES-268:
--------------------------------------

This is not a bug, try to add the attribute immediate="true" in your cancelButton and then the values won't get updated,

Bruno

> 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

>
> 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


[jira] Commented: (MYFACES-268) inputText displays wrong value.

Posted by "Konstantin Nikolaev (JIRA)" <my...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-268?page=comments#action_67001 ] 

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

Thanks Bruno, that helped a little bit, but one problem with old values in inputTexts still exists.
Now, if I cancel changes, I navigate to the page displaying user profile with no changes (this is what I wanted), but if I navigate (via link) back to the form for editing profile, I get new (i.e. changed) values in the inputTexts. This is wrong. Data in the inputTexts should be old, because I canceled changes...

> 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

>
> 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


[jira] Closed: (MYFACES-268) inputText displays wrong value.

Posted by "Martin Marinschek (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-268?page=all ]
     
Martin Marinschek closed MYFACES-268:
-------------------------------------

    Fix Version: Nightly Build
     Resolution: Invalid

> 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
>      Fix For: Nightly Build

>
> 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


[jira] Commented: (MYFACES-268) inputText displays wrong value.

Posted by "Konstantin Nikolaev (JIRA)" <my...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-268?page=comments#action_12312880 ] 

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

One more comment:
If we remove immediate="true", MyFaces converts data in the inputTexts and if there are errors cancel button doesn't work again.

> 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


[jira] Commented: (MYFACES-268) inputText displays wrong value.

Posted by "Martin Marinschek (JIRA)" <my...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-268?page=comments#action_12312671 ] 

Martin Marinschek commented on MYFACES-268:
-------------------------------------------

What if you clean out your bean if the cancel button is hit - connect the cancel button to an action, and delete the backing bean on this action (then re-read it from the database)

regards,

Martin

> 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

>
> 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


[jira] Commented: (MYFACES-268) inputText displays wrong value.

Posted by "Konstantin Nikolaev (JIRA)" <my...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-268?page=comments#action_12313149 ] 

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

I will try to describe the problem in other words.
I have a list of objects (users) with edit button next to each object. When I hit edit button I go to edit form with inputTexts, save and cancel buttons (cancel button has immediate="true" attribute). If I press cancel button on the edit form I go back to my list of objects. 

1. I press edit button next to user 1.
2. I get to the edit form with user 1 data in the inputTexts.
3. I press SAVE button and go back to my list.
4. I hit edit button next to user2.
5. I get to the edit form with user 2 data in the inputTexts.

But the next steps cause the problem:
1. I press edit button next to user 1.
2. I get to the edit form with user 1 data in the inputTexts.
3. I press CANCEL button and go back to my list.
4. I hit edit button next to user2.
5. I get to the edit form with user 1 data in the inputTexts. (This is wrong, the form should contain user2 data)

> 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


[jira] Commented: (MYFACES-268) inputText displays wrong value.

Posted by "Konstantin Nikolaev (JIRA)" <my...@incubator.apache.org>.
    [ 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


[jira] Commented: (MYFACES-268) inputText displays wrong value.

Posted by "Martin Marinschek (JIRA)" <my...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-268?page=comments#action_12312906 ] 

Martin Marinschek commented on MYFACES-268:
-------------------------------------------

Another hint: I don't know if you really want to do this, but if you want to reset your data in the edit-fields, you can use the attribute 'type' and set it to 'reset' in your commandButton.

regards,

Martin

> 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