To get the selected Value from selectOneChoice (LOV) in Bean
<af:selectOneChoice value="#{row.bindings.LevelType.inputValue}"
id="soc3"
label="#{row.bindings.LevelType.label}"
valueChangeListener="#{backingBeanScope.GroupingBean.onSubtypLvllTypValChnge}"
autoSubmit="true">
<f:selectItems value="#{row.bindings.LevelType.items}" id="si3"/>
<f:attribute name="rowIndexVal" value="#{row.bindings.LevelType.items[row.bindings.LevelType.inputValue].label}"/>
</af:selectOneChoice>
public void onSubtypLvllTypValChnge(ValueChangeEvent valueChangeEvent) {
valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentInstance());
Map p = ((UIComponent)valueChangeEvent.getSource()).getAttributes();
System.out.println("Selected Value"+p.get("rowIndexVal"));
}
One can find a different other approaches here..
http://mjabr.wordpress.com/2011/03/19/reading-the-selected-value-of-a-select-list-in-java/
http://myadfnotebook.blogspot.com/2010/09/getting-string-value-or-item-code-of.html
<af:selectOneChoice value="#{row.bindings.LevelType.inputValue}"
id="soc3"
label="#{row.bindings.LevelType.label}"
valueChangeListener="#{backingBeanScope.GroupingBean.onSubtypLvllTypValChnge}"
autoSubmit="true">
<f:selectItems value="#{row.bindings.LevelType.items}" id="si3"/>
<f:attribute name="rowIndexVal" value="#{row.bindings.LevelType.items[row.bindings.LevelType.inputValue].label}"/>
</af:selectOneChoice>
public void onSubtypLvllTypValChnge(ValueChangeEvent valueChangeEvent) {
valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentInstance());
Map p = ((UIComponent)valueChangeEvent.getSource()).getAttributes();
System.out.println("Selected Value"+p.get("rowIndexVal"));
}
One can find a different other approaches here..
http://mjabr.wordpress.com/2011/03/19/reading-the-selected-value-of-a-select-list-in-java/
http://myadfnotebook.blogspot.com/2010/09/getting-string-value-or-item-code-of.html