• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Value Change Listener

 
Ranch Hand
Posts: 210
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try removing the OnChange attribute.
 
ramesh maredu
Ranch Hand
Posts: 210
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic