3 Replies Latest reply: Aug 28, 2013 7:11 AM by Nitish_Potti RSS

    setting selectItems value programmaticly..

    webcentercontentnewbie

           Hi ,

       

      I have drop down.it is working fine.But on one scenario, i need to show different value in drop down...

       

      can i set #{bindings.ProductGrpDisable.items} value programmatcly in bean???

       

      if yes then tell me???

        • 1. Re: setting selectItems value programmaticly..
          Nitish_Potti

          Hi,

           

          point the f:selectItems value to a list in the bean.

          In the getter, you can construct Select Items. Below is the sample snippet.

           

              public List getSelectItemist() {

                  if (selectItemList== null) {

                      selectItemList= new ArrayList();

                      DCBindingContainer bindings = ADFUtil.getDCBindingContainer();

                      DCIteratorBinding iteratorbinding =

                          bindings.findIteratorBinding("yourVoiterator");

                      if (iteratorbinding != null) {

                          Row[] rows = iteratorbinding.getAllRowsInRange();

                          String value = null;

                          Long key = 0L;

                          for (Row row : rows) {

                              value = (String)row.getAttribute("yourattr");

                              key = (Long)row.getAttribute("yourId");

                              selectItemList.add(new SelectItem(key.toString(), value));

                          }

                      }

                  }

                  return selectItemList;

              }

           

          Thanks

          • 2. Re: setting selectItems value programmaticly..
            webcentercontentnewbie

            problem is this.i cant point value of items to bean.. it is dependent LOV, only in one case i need to set this value as #{bindings.productGrp.items}

            is it possible

            • 3. Re: setting selectItems value programmaticly..
              Nitish_Potti

              I think you have to elaborate your usecase more.