[prev in list] [next in list] [prev in thread] [next in thread] 

List:       myfaces-user
Subject:    Re: inputHidden is not rendered correctly on immediate action
From:       simon <simon.kitching () chello ! at>
Date:       2008-05-27 19:15:45
Message-ID: 1211915745.6137.5.camel () simon-laptop
[Download RAW message or body]


On Tue, 2008-05-27 at 06:46 -0700, Jan Ziegler wrote:
> looked at the articel again - in the end it says:
> "Non-validated EditableValueHolder (UIInput) components render their
> submitted value, not the backing bean or local value."
> 
> ok, this is an explanation! 

Yep. The value in the submitted form data will have been stored into the
h:inputHidden component as a string. But an immediate command component
will run before that string value gets converted, validated and pushed
into the model. That's the point; you want the immediate action to run
even when submitted data fails to convert or validate.

If the immediate action does nothing, then normal page processing
continues.

If the immediate action causes the current page to be re-rendered, then
the hidden field will render that unconverted/unvalidated string value.
This is done because even when conversion or validation fails for a
component you don't want to throw the user input away.

But if the immediate action causes a new view to be created, then that
submitted data will be lost, because that particular h:inputHidden
component has been thrown away and the data it contained was never
pushed into any model object.

Regards,
Simon

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic