I added ValueChangeListener property on radio and dropdownbox, but only that method registered with radio selection is getting called even if i change the dropdown value
this is the code
and backing bean NewCustomerPOJO.java
whats happening is , once i click on <h:selectOneRadio> selection to "YES", method getIt() of NewCustomerPOJO.java is called,
now the problem is if i change the value of <h:selectOneMenu>, the same getIt() method of NewCustomerPOJO.java is called,
but what i was trying to achive is to invoke is method getIt() of CustomerPOJO.java .
Why is this happening ?
Why valuechangeListener for same method is called.
What i want is for <h:selectOneRadio>, method getIt() of NewCustomerPOJO.java should be called,
and for <h:selectOneMenu>, method getIt() of CustomerPOJO.java should be called
Joined: Jun 17, 2009
now if we have two valuechangeListener in same form , and if i want to call two different function for each valuechange, what should i do ?
Joined: Apr 15, 2008
You are right. It was my mistake. But as I understand it you can still use commandButton to send the form and it should still fire the correct method executions in backin bean.
And it should be possible to have more than one valueChangeListeners in one form since it is possible to have more than one valuechangelisteners on a single element.
If you want to check whether your problem lies on the fact that there are two valuechangelisteners then you can remove the other one temporarily to see if after that the other starts working...
But your valuechangelisteners need not be on a same form! Since you submit the form right away after you change either value it means basically that you are interested only in one value change at a time. So you can also use two forms if nothing else helps