Hi ADF Experts,
JDEv version
I have two VO's and both the VO's are dragged as a selectOneChoice as below
VO1
select FIRST_NAME from employees where job_id = 'AD_VP'
VO2
select department_name from departments where location_id >1500
<af:selectOneChoice value="#{bindings.ViewObj1.inputValue}"
label="#{bindings.ViewObj1.label}"
binding="#{backingBeanScope.TestBean.lov1}"
autoSubmit="true" shortDesc="#{bindings.ViewObj1.hints.tooltip}"
unselectedLabel="--Select--" id="soc1">
<f:selectItems value="#{bindings.ViewObj1.items}" id="si1"/>
</af:selectOneChoice>
<af:selectOneChoice value="#{bindings.ViewObj1_1.inputValue}"
label="#{bindings.ViewObj1_1.label}"
autoSubmit="true" shortDesc="#{bindings.ViewObj1_1.hints.tooltip}"
unselectedLabel="--Select--" id="soc2"
binding="#{backingBeanScope.TestBean.lov2}">
<f:selectItems value="#{bindings.ViewObj1_1.items}" id="si2"/>
</af:selectOneChoice>
There's a add button where I want to validate if user has selected any value. But the validation fails because it assumes the unselected label as index 0. Also it assumes the first selected index as index 0
I tried to print the values of unselected label and first selected index. It gives 0 in both case.
| | System.out.println(lov1.getValue()); |
| | System.out.println(lov2.getValue()); |
| | lov1.setValue(-1); |
| | lov2.setValue(-1); |
| // | lov1.resetValue(); |
| // | lov2.resetValue(); |
| | AdfFacesContext.getCurrentInstance().addPartialTarget(lov1); |
| | AdfFacesContext.getCurrentInstance().addPartialTarget(lov2); |
So, how to reset both values on click of Add button. DO I need to reexecute the query of both VO's?
Thanks,
Roy