Hi guys
I have a code in which depending on the value of dropdown selected a datatable has to be populated .
<h:selectOneMenu value="#{IOUUnitCreationBackingBean.iouSelected}" styleClass="FontArialBoldSmall" valueChangeListener="#{IOUUnitCreationBackingBean.changeValue}"
style="margin-top:15px;border: 6px solid #a8c0e2;margin-left:17px;font-family: Arial;font-size: 11px;font-style: normal;font-weight: normal;text-decoration: none;" disabled="#{IOUUnitCreationBackingBean.numberOfIOUUnderIOUHR == 1}" onchange="this.form.submit();" >
<f:selectItems value="#{IOUUnitCreationBackingBean.list}" />
</h:selectOneMenu>
public void changeValue(ValueChangeEvent vce) {
this.iouSelected=(
String)vce.getNewValue();
this.change();
try
{
IOUUnitCreationDAO unitCr = new IOUUnitCreationDAO();
this.unitList = unitCr.unitDetailList(this.iouSelected,activityCode);
}
catch(Exception e){
logger.error(Arrays.asList(e.getMessage()));
logger.error(Arrays.asList(e.getStackTrace()));
message = rb.getString("UNABLE_TO_PROCESS");
ResourceUtils.addMessage(message, FacesMessage.SEVERITY_INFO);
}
//IOUUnitCreationBackingBean i=new IOUUnitCreationBackingBean();
logger.error("this.iouSelected============>"+ this.iouSelected);
}
I am using value listener to get the new value but what is happening is for the first time binding is fine but for the next time onwards old value are being binded in the datatable..tried a lot of things but it didn't work. please suggest what to do.?