valuechangelistener
600718Apr 21 2008 — edited Apr 21 2008hi
plz help me with this.
in my page i have a <h:selectOneMenu>. and i have populated it with an arraylist from the backing bean. i have bounded a valuechangelistener to this so that i could get the changed value when the new value is selected/but here im getting a null pointer exception.
plz help me with this.
<h:selectOneMenu
value="#{regBean.selectedState}" valueChangeListener="#{regBean.comboEvent}"
binding="#{regBean.cmbState}" onchange="this.form.submit();"
style=" position:absolute;left:400px;top:300px;width:135px;">
<f:selectItems value="#{regBean.stateList}" />
</h:selectOneMenu>
public void comboEvent(ValueChangeEvent ve){
try {
String val=ve.getOldValue().toString();
System.out.println(ve.getNewValue().toString());
} catch (Exception e) {
e.printStackTrace();
}
when i try to print the old value its coming.but when i try to print the newvalue im getting the error.
rgds