Hello, i use Jdev 10g
values for f:selectItems in bean i'm get from DB and set to list
list = new ArrayList<SelectItem>();
ViewObject vo = am.findViewObject("CountryView");
while (vo.hasNext()) {
CountryViewRowImpl row = (CountryViewRowImpl)vo.next();
SelectItem item = new SelectItem();
item.setValue(row.getCountryCode().stringValue());
item.setLabel(row.getCountryName());
list.add(item);
}
<af:iterator value="#{informClient_bean.fields}" var="row"
rows="40">
<af:switcher id="sw1" facetName="#{row.type}"
defaultFacet="Text">
<f:facet name="9">
<af:selectOneChoice value="#{row.value}"
requiredMessageDetail="обязательное поле не заполнено"
autoSubmit="#{row.autoSubmit}"
immediate="#{row.immediate}"
label="#{row.label}"
required="#{row.requared}"
readOnly="#{row.readOnly}"
onmouseup="validMask();"
shortDesc="#{row.shortDesc}">
<f:selectItems value="#{row.list}"/>
</af:selectOneChoice>
</f:facet>
</af:switcher>
</af:iterator>
when working with a form, select a value from the code we get the selected value .... but sometimes (for example, if the field is read-only true) then the selected value is not the same.
value label
1 a
4 b
5 c
If I choose "b" when working on the shape of the code will be 4
if I open the form and read only true in the bean I get a code 1 and the value of "a"