This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ValueChangeEvent not changing value  RSS feed

 
Steve Aye
Greenhorn
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}"/>
</h:selectOneMenu>


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();
qsbb.setNameFilter(nameFilter);
}
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!