By the way:
I have other selectOneMenus/valueChangeListener methods, where invoking one valueChangeListener method doesn't affect any other valueChangeListener method, although I also modify other selectOneMenu values in the valueChangeListener method invoked. I always call FacesContext.getCurrentInstance().renderResponse() at the end of each valueChangeListener method, and this causes the lifecycle to continue with the render response phase after the valueChangeListener method is left. But in the one case described, a second valueChangeListener method is invoked after the first, and not renderResponse. > -----Ursprüngliche Nachricht----- > Von: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Auftrag > von Matthias Kahlau > Gesendet: Mittwoch, 14. Dezember 2005 22:40 > An: Users MyFaces > Betreff: Problem with valueChangeListener method invocation > > > Hi! > > > I have a valueChangeListener method which belongs to a selectOneMenu > (immediate), and the form is submitted when the value changes by using > JavaScript. In the valueChangeListener method, I modify the value > of another > selectOneMenu, which also has a valueChangeListener method. > > The problem is, that when the valueChangeListener method of the first > selectOneMenu is invoked, and the value of the second selectOneMenu is > modified, the valueChangeListener method of the second > selectOneMenu is also > invoked, and I don't understand why. It should only be invoked > when the user > changes the value. > > The second invocation causes some unnecessary computations, and the main > problem is, with the wrong value. It uses the old value that it had before > the value had been changed in the first valueChangeListener > method, and not > the new value created in the first valueChangeListener. > > That causes that the page is redisplayed with the wrong items shown in the > table. > > > So why is the second valueChangeListener method invoked, and why with the > wrong "new value", which is the "old value"? > > And how can that problem be solved? > > > > Regards, > > Matthias >

