How to get LOV value instead of index when it is used in "selectOneChoice" component in the table row?

   When using LOV's, a common issue in ADF is to get selected value instead of index when LOV is used to render for example "selectOneChoice" component. I've faced it when "selectOneChoice" was used in table. That means every row in table can have different selection of LOV values. Thus we can't rely on iterators current row and simply to access desired attribute by using attribute binding. But we can simply access it through EL:

We have LOV based attribute "MyAttribute" in table. In GUI it is rendered as selectManyChoice:

  <af:selectOneChoice value="#{row.bindings.MyAttribute.inputValue}"
                        label="#{row.bindings.MyAttribute.label}" id="soc1">
      <f:selectItems value="#{row.bindings.MyAttribute.items}" id="si1"/>
    </af:selectOneChoice>

To access selected item, we can use:

  • "#{row.bindings.MyAttribute.inputValue}" - will get an LOV index of selection "
  • "#{row.bindings.MyAttribute.attributeValue}" - will get a LOV value of selection







No comments:

Post a Comment