• Post Reply Bookmark Topic Watch Topic
  • New Topic

valueChangeListener not working  RSS feed

 
Abiodun Adisa
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
Please i am using a valueChangeListener in my tag but its not working, I have
<af:selectOneChoice label="Label 1" valueChangeListener="#{backing_chart.categorySelecteds}" attributeChangeListener="#{backing_chart.categorySelected}" > its suppose to execute the method

public void categorySelecteds(ValueChangeEvent event) but the method is not getting executed when i change the value in the drop down
 
David Ronan Burns
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to provide the "value" and "onSubmit "attributes in the tag, otherwise the listener won't fire. the "onsubmit" informs the servlet that the form is to be submitted. As a result the JSF lifecycle is activated and all datavalues that are set during the "Apply Request Values"
phase will check for listeners and fire them if they exist. As you've not defined the "value" attribute in the tag the listener is not fired
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!