Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

valuechangelistener

600718Apr 21 2008 — edited Apr 21 2008
hi

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 19 2008
Added on Apr 21 2008
1 comment
307 views