This discussion is archived
1 2 Previous Next 17 Replies Latest reply: Jul 31, 2013 5:36 AM by vinaykumar2 Go to original post RSS
  • 15. Re: adding new option in selectonechoice
    Timo Hahn Oracle ACE
    Currently Being Moderated

    I made a test case with out use case:

    here is the code from the page. mySeletion1 is an Integer variable in the binding layer.

                            <af:panelGroupLayout id="pgl2">

                                <af:selectOneChoice label="Label 1" id="soc1" value="#{bindings.mySeletion1.inputValue}" autoSubmit="true">

                                    <f:selectItems value="#{viewScope.SelectOneBean.valueList}" id="si1"/>


                                <af:outputText value="Selected Value: #{bindings.mySeletion1.inputValue}" id="ot2" partialTriggers="soc1"/>


    here is the bean code

        List<SelectItem> valueList = null;



        public List<SelectItem> getValueList() {

            if (valueList == null || valueList.size() == 0) {

                valueList = getYourValueListFromServiceByRunningQuery();




            return valueList;




        private List<SelectItem> getYourValueListFromServiceByRunningQuery()




            valueList = new ArrayList<SelectItem>();

            List valueListFromBinding = new ArrayList();

            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();

            // Get a attribute value of the current row of iterator

            DCIteratorBinding iterBind = (DCIteratorBinding) bindings.get("DepartmentsIterator");






            RowSetIterator rowIter = iterBind.getRowSetIterator();

            Integer count = 0;

            while (rowIter.hasNext()) {


                SelectItem selItNew = new SelectItem();

                Row row =;

                String nameValue = (String) row.getAttribute("DepartmentName");

                System.out.println("configGrp name: " + nameValue);







            SelectItem selIt = new SelectItem();







            return valueList;


    As I don't have your data I use the departments VO to get the names for the select items.



  • 16. Re: adding new option in selectonechoice
    webcentercontentnewbie Newbie
    Currently Being Moderated

    thanks it wkred....

  • 17. Re: adding new option in selectonechoice
    vinaykumar2 Expert
    Currently Being Moderated

    see this af:selectonechoice not getting updated | They point the finger at me.. again!



    it will help u. Set value as integer.if u need the value of selectonechoice. when u set value in selectitem, u can also put value and label in hashmap, and using valuchangelistener u can get the integer value and pass into hashmap and get value of selectonechoice...

1 2 Previous Next


  • Correct Answers - 10 points
  • Helpful Answers - 5 points