Thursday 18 April 2013

How to get the value of the selected item in SelectOneChoice?

First way: set valuePasstrhu attribute to true. By default it will be false so it will return index of the selected item

Second way use the following code:

 public Row getLovRowAtIndex(String lovAttrName, Integer index) {
        Row row = null;
        try {
            DCBindingContainer binding = ADFUtils.getDCBindingContainer();
            JUCtrlListBinding list =
                (JUCtrlListBinding)binding.get(lovAttrName);
            String selectedValue = (String)list.getAttributeValue();
            list.getListIterBinding().setCurrentRowWithKeyValue(selectedValue);
            row = list.getListIterBinding().getRowAtRangeIndex(index);
        } catch (Exception e) {
           System.err.println("Error while getting row from LOV : " + e);
        }
        return row;
    }

Third way: Bind the Value attribute to the binding, when user selects an item then the corresponding value will be stored in to the binding.

1 comment:

jacquettagaeth said...

How much does the jackpot win in a casino win in 2021?
Jackpot 동해 출장샵 Winners 광주광역 출장안마หารายได้เสริม Jackpot Winners. They 제주 출장마사지 can win if they win by 1 point. They will be considered unlucky if 안성 출장샵 not