You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Simon Kitching <sk...@obsidium.com> on 2006/01/04 00:06:11 UTC

Clearing input components in a page

Hi,

There was a question recently about how to force input components to 
render values from the model rather than their current "submitted value".

As this question has been asked a few times, I've created a wiki page 
with some information on this. If you have more info, or corrections to 
the info currently on that page, please update it!

   http://wiki.apache.org/myfaces/ClearInputComponents

Regards,

Simon

Re: Clearing input components in a page

Posted by Simon Kitching <sk...@obsidium.com>.
And I agree too. The wiki has been updated.
Thanks for the correction Matthias.

Martin Marinschek wrote:
> You're right, Matthias.
> 
> two calls necessary for that isLocalValueSet needs to be reset as well.
> 
> regards,
> 
> martin
> 
> On 1/4/06, Matthias Kahlau <mk...@web.de> wrote:
>> Hi Simon!
>>
>>
>> I think setting the submitted value of EditableValueHolder components to
>> null will only be sufficient, if the components are non-immediate. If an
>> EditableValueHolder component is immediate, the conversion and validation of
>> that component will occur in the apply request values phase, before the
>> action method of the immediate command component is invoked at the end of
>> this phase.
>>
>> When the conversion & validation of the immediate EditableValueHolder
>> component is successful, its local value will be set to the converted value
>> and the submitted value will be set to null. In this case, it will be
>> necessary to set the local value of that component to null to clear it and
>> force fetching the model value in the render response phase. Please correct
>> me, if I'm wrong.
>>
>>
>>
>> Regards,
>>
>> Matthias
>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: users-return-14598-mkahlau=web.de@myfaces.apache.org
>>> [mailto:users-return-14598-mkahlau=web.de@myfaces.apache.org]Im Auftrag
>>> von Simon Kitching
>>> Gesendet: Mittwoch, 4. Januar 2006 00:06
>>> An: MyFaces Discussion
>>> Betreff: Clearing input components in a page
>>>
>>>
>>> Hi,
>>>
>>> There was a question recently about how to force input components to
>>> render values from the model rather than their current "submitted value".
>>>
>>> As this question has been asked a few times, I've created a wiki page
>>> with some information on this. If you have more info, or corrections to
>>> the info currently on that page, please update it!
>>>
>>>    http://wiki.apache.org/myfaces/ClearInputComponents
>>>

> 
> 


Re: Clearing input components in a page

Posted by Martin Marinschek <ma...@gmail.com>.
You're right, Matthias.

two calls necessary for that isLocalValueSet needs to be reset as well.

regards,

martin

On 1/4/06, Matthias Kahlau <mk...@web.de> wrote:
> Hi Simon!
>
>
> I think setting the submitted value of EditableValueHolder components to
> null will only be sufficient, if the components are non-immediate. If an
> EditableValueHolder component is immediate, the conversion and validation of
> that component will occur in the apply request values phase, before the
> action method of the immediate command component is invoked at the end of
> this phase.
>
> When the conversion & validation of the immediate EditableValueHolder
> component is successful, its local value will be set to the converted value
> and the submitted value will be set to null. In this case, it will be
> necessary to set the local value of that component to null to clear it and
> force fetching the model value in the render response phase. Please correct
> me, if I'm wrong.
>
>
>
> Regards,
>
> Matthias
>
> > -----Ursprüngliche Nachricht-----
> > Von: users-return-14598-mkahlau=web.de@myfaces.apache.org
> > [mailto:users-return-14598-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> > von Simon Kitching
> > Gesendet: Mittwoch, 4. Januar 2006 00:06
> > An: MyFaces Discussion
> > Betreff: Clearing input components in a page
> >
> >
> > Hi,
> >
> > There was a question recently about how to force input components to
> > render values from the model rather than their current "submitted value".
> >
> > As this question has been asked a few times, I've created a wiki page
> > with some information on this. If you have more info, or corrections to
> > the info currently on that page, please update it!
> >
> >    http://wiki.apache.org/myfaces/ClearInputComponents
> >
> > Regards,
> >
> > Simon
>
>


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

AW: Clearing input components in a page

Posted by Matthias Kahlau <mk...@web.de>.
Hi Simon!


I think setting the submitted value of EditableValueHolder components to
null will only be sufficient, if the components are non-immediate. If an
EditableValueHolder component is immediate, the conversion and validation of
that component will occur in the apply request values phase, before the
action method of the immediate command component is invoked at the end of
this phase.

When the conversion & validation of the immediate EditableValueHolder
component is successful, its local value will be set to the converted value
and the submitted value will be set to null. In this case, it will be
necessary to set the local value of that component to null to clear it and
force fetching the model value in the render response phase. Please correct
me, if I'm wrong.



Regards,

Matthias

> -----Ursprüngliche Nachricht-----
> Von: users-return-14598-mkahlau=web.de@myfaces.apache.org
> [mailto:users-return-14598-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> von Simon Kitching
> Gesendet: Mittwoch, 4. Januar 2006 00:06
> An: MyFaces Discussion
> Betreff: Clearing input components in a page
>
>
> Hi,
>
> There was a question recently about how to force input components to
> render values from the model rather than their current "submitted value".
>
> As this question has been asked a few times, I've created a wiki page
> with some information on this. If you have more info, or corrections to
> the info currently on that page, please update it!
>
>    http://wiki.apache.org/myfaces/ClearInputComponents
>
> Regards,
>
> Simon