Thanks Julian,
You made me reread faces docs, you are right.
ValueChangeListeners are called after Process Validators Phase, and
the model (Components values) is only updated (in the Update Model
Values Phase) after processing the ValueChange events.
Well I must correct my code, and simply trust myfaces implementation.
This is my third conflict between sun's implementation and myfaces,
and in all cases myfaces was correct.
Thanks again
tonio
On Fri, 2006-06-02 at 18:20 -0400, Julian Ray wrote:
> Hmmm, I always thought that the model had not been updated when the
> ValueChangeListener event is sent in which case the value would be the old
> value and the new value is only available via event.getNewvalue(). If you
> call renderResponse() from the value change listener it bypasses all model
> updates -- or am I misinformed?
>
> -----Original Message-----
> From: Tonio Caputo [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 02, 2006 5:49 PM
> To: MyFaces-Users-List
> Subject: HtmlSelectOneMenu value is not set during
> ValueChangeListenerexecution
>
> Hi everybody,
>
> I'm changing my application to run with myfaces 1.1.1, it was developed
> using sun's reference implementation, and it is working ok.
>
> The problem I'm having is the value HtmlSelectOneMenu.getValue() returns
> during the execution of ValueChangeListener.processValueChange() method.
>
> In sun's reference implementation the returned value is the
> event.getNewValue() in myfaces the returned value is event.getOldValue()
>
> As I understand during the ApplyRequestValue Phase all the values from the
> request are stored in the corresponding component, so sun's implementation
> is correct.
>
> May be I'm misunderstanding some spec, maybe my code is mistaken, but I'm
> getting a lot of trouble because I'm assuming that the component's value is
> the new one.
>
> I will describe basically my application:
>
> FormData - All the values components/selectItems
> had in the last request
> - Session scope
>
> Page/JSP - Java Class with all the components transient
> - JSP page with all its components bound to the
> Page's ones.
> - Request scope
>
> STATE_SAVING_METHOD is client.
>
> The readObject method of my Page is overridden, and this is what
> it is doing:
> 1. calls in.defaultReadObject()
> 2. creates all Html/UISelectItems components
> 3. FormData values (components and selectItems) are
> stored in the recently created components
>
> Any help or comment will be welcomed
>
> Thanks in advance
> tonio
> PD: I was really surprised not to find any e-mails regarding this problem in
> the list.
>
>
>
>
>