| Author |
Value Change Listener
|
ramesh maredu
Ranch Hand
Joined: Mar 15, 2008
Posts: 210
|
|
Hi i am very new to JSF, i started learning it now, i found it interesting,but I stuck in one problem in my jsf i have one <h:selectOneRadio/> component and another <h:selectOneMenu/>, i want to change values of each component and want to read values in managed bean. First Component is <h:selectOneRadio disabledClass="selectOneRadio_Disabled" onchange="submit()" enabledClass="selectOneRadio_Enabled" id="radio1" valueChangeListener="#{pc_Ramesh.handleMenu1ValueChange}" styleClass="selectOneRadio"> <f:selectItems value="#{pc_Ramesh.values}"> </f:selectItems> </h:selectOneRadio> and second is <h:selectOneMenu id="menu1" styleClass="selectOneMenu" onchange="submit()" valueChangeListener="#{pc_Ramesh.handleMenu1ValueChange}"> <f:selectItem itemValue="red" itemLabel="Red"/> <f:selectItem itemValue="red1" itemLabel="Red1"/> </h:selectOneMenu> the only difference between them is f:selectItem and f:selectItems. if i hard code data using f:selectItem then onchange of value data is going to valuechangelistener. but if i use f:seletItems to populate data dynamically from managed bean on change of value, value chagne listener is not being invoked at all. Please suggest me any solution.
|
SCJP 1.5 94%.
The greatest glory in living lies not in never falling, but in rising every time we fall.
|
 |
Andres Quinones
Ranch Hand
Joined: Oct 09, 2006
Posts: 57
|
|
I think that you should test the onclick event on the h:selectOneRadio because I think that the onchange is never called. Hope this helps.
|
 |
Joe Matthew
Ranch Hand
Joined: Jun 10, 2008
Posts: 66
|
|
|
Try removing the OnChange attribute.
|
Regards,<br />Joe<br /> <br />"Always program as if the person who will be maintaining your program is a violent psychopath that knows where you live."<br />--Martin Golding
|
 |
ramesh maredu
Ranch Hand
Joined: Mar 15, 2008
Posts: 210
|
|
Hi All, Thanks for your replies, i modified the code according to your suggestions but problem remains same, If i use f:selectItem in selectOneRadio then it is working with on click event.
|
 |
 |
|
|
subject: Value Change Listener
|
|
|