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

Mathias Werlitz commented on MYFACES-277:
-----------------------------------------

This new change would fix 3. and 4. But it does not help my component, because 
the sense of the component is to skip the validation and update model phase and 
to allow only the full cycle for a group of components. This way the view 
behaves like only a part of a form was submitted. The component expects that 
the submitted value of the unvalidated components is stored, so the user don't 
have to reenter all the values. 
I will send you the code shortly.

I think the complete fix is not a desired behaviour: the component now behaves 
different on what phases it cycles. Thats some kind of inconsistent behaviour. 
The fix is more an addidtional feature for the x:input component, that can be 
turned on on demand,  to reset the displayed value to the model value. The code 
of x:input could be easily extended.

By the way I had a similar problem like the initial bug description. I simply 
solved this by navigating to the same view with a command component 
(immediate=true). A new view will be created, the input fields lose their 
values and the updated model data is displayed.

Consider this additional use case that is now extremely unfriendly to the user 
with the new behaviour:
There are multiple forms in a view. The user submits form A. There are 
validation errors -> redisplay.
Now he submits form B, there are also validation errors. But now all values of 
form A are lost.

To summarize: I think the fix is not a desired behaviour of the standard 
UIInput because it breaks existing applications an should moved as a special 
feature to x:input components.

> using a button with immediate on a form with a dataTable component
> ------------------------------------------------------------------
>
>          Key: MYFACES-277
>          URL: http://issues.apache.org/jira/browse/MYFACES-277
>      Project: MyFaces
>         Type: Bug
>     Reporter: Tamietto Claudio
>      Fix For: Nightly Build

>
> i'm using a form that contain a dataTable component . There is also a button 
> that modify the model of the table with
> an array of only one element with the single fields initialized to "" (String 
> fields) and has the attribute immediate set
> to true. When the form is rendered after i have pressed the button with the 
> immediate attribute set  to true ,the value that i obtain is the value 
> submitted and not the value of the model.
> I have found the following workaround that i have put on a properties of the 
> row of the table that is called on the rendering phase:
> if (component.getSubmittedValue() != null &&
>     arrayOfRecord[model.getRowIndex()].getCodice() != null &&
>     
> !component.getSubmittedValue().equals(arrayOfRecord[model.getRowIndex()].getCodice()))
>  {
>       
> component.setSubmittedValue(arrayOfRecord[model.getRowIndex()].getCodice());
> }
> I have used the value of the model  and not the component.getValue() because 
> also this was not the same
> of the value of te model.
> I can try to create a simple case if it is necessary o the problem is not 
> clear.
> The problem seems the same of the issue 187  (that it is closed) but i i have 
> tested the night builds and nothing
> changed. However in the release notes of the night builds the issue is not 
> reported as solved.

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