Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ValueChangeEvent not changing value

Steve Aye
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a dropdown list on my JSP page that is bound to a valueChangeListener event in my backing bean. The problem is, when I select a value in my dropdown list, it doesn't populate this new selected value in the field. It simply defaults it back to the original value. What am I missing? The JSP code is as follows:

<h:selectOneMenu id="name_filter" value="#{qsSelectionBB.nameFilter}" onchange="submit()" valueChangeListener="#{qsSelectionBB.nameFilterListener}" tabindex="1" >
<f:selectItems value="#{codesManagerBB.questionSetNameSelectItemRay}"/>

and my backing bean has the following method:

public void nameFilterListener(ValueChangeEvent e) {
FacesContext facesContext = FacesContext.getCurrentInstance();
ExternalContext externalContext = facesContext.getExternalContext();
Map sessionMap = externalContext.getSessionMap();
QuestionSetSelectionBB qsbb = (QuestionSetSelectionBB)sessionMap.get("qsSelectionBB");
nameFilter = (Integer)e.getNewValue();
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic