Matthias,
Well, I understood what was going on.
The event source correctly return the UIComponent that
generated the event, the problem is that the
BakingBean Components are not updated during the execution of the
ValueChangeListener.processValueChange() method.
If I look the at the BakingBean after the UpdateModel phase, the
getSource() is correctly containing a reference to the updated
UIComponent.
Thanks a lot, and I will use myFaces valueChangeNotifier for the rest
of my life.
On Mon, 2006-06-05 at 20:12 -0700, Matthias Wessendorf wrote:
> Have you tried "getComponent()" which is defined in FacesEvent?
> The getSource() comes from java.util.Event clazz.
>
> In MyFaces getComponent() is *only*:
> return (UIComponent) getSource();
>
>
> So can you tell us, what you get form a "getSource()" call?
>
> -Matthias
>
> On 6/5/06, Tonio Caputo <[EMAIL PROTECTED]> wrote:
> > Hi everybody,
> >
> > I'm moving my application from sun's implementation
> > (it's working ok) to myfaces.
> >
> > I'm using:
> > jsf 1.1-01
> > myfaces 1.1.1
> >
> > I'm having a difference in behavior regarding
> > valueChangeEvent source.
> >
> > My application:
> > ~~~~~~~~~~~~~~~
> >
> > JSP - Jsp with standard JSF components,
> > all bound to components in a java Page
> >
> > Page - Java class with all components of the JSP page
> > - It adds ValueChangeListeners to the components
> > who need it.
> > - Request Scope
> >
> > My code for ValueChangeListener looks something like this:
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > public void processValueChange(ValueChangeEvent ev)
> > {
> > ......
> > Object src=ev.getSource();
> > if ( src.equals(_cmbCountry) ) do.......
> > else if ( src.equals(_cmbAnyCode) ) do........
> > else if ( src.equals(_cmbState) ) do......
> > else
> > do nothing .......
> > ........
> > }
> >
> > where _cmbXXX are HtmlSelectOneMenu components
> > defined in the Page class.
> >
> > The problem:
> > ~~~~~~~~~~~~
> >
> > In my faces, the event source does not match any of the
> > the components, in sun's implementation it does.
> >
> > If I change the equals function for ==, it doesn't work
> > either (as expected, there is a new Page for each request)
> >
> >
> > The question:
> > ~~~~~~~~~~~~~
> >
> > Is this OK, a myfaces problem, a bad implementation (as usual)
> > of sun's reference, or just worked by chance ?
> >
> > The solution of this problem is easy, I'm just checking to see
> > what goes on.
> >
> >
> > Thanks in advance
> > tonio
> >
> >
>
>