Friday, March 30, 2012

Get the selected Value from SelectOneChoice(LOV) in Bean

To get the selected Value from selectOneChoice (LOV) in Bean


<af:selectOneChoice value="#{row.bindings.LevelType.inputValue}"
 id="soc3"
label="#{row.bindings.LevelType.label}"
valueChangeListener="#{backingBeanScope.GroupingBean.onSubtypLvllTypValChnge}"
autoSubmit="true">
<f:selectItems value="#{row.bindings.LevelType.items}" id="si3"/>
<f:attribute name="rowIndexVal" value="#{row.bindings.LevelType.items[row.bindings.LevelType.inputValue].label}"/>
</af:selectOneChoice>




public void onSubtypLvllTypValChnge(ValueChangeEvent valueChangeEvent) {

        valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentInstance());
        Map p = ((UIComponent)valueChangeEvent.getSource()).getAttributes();
        System.out.println("Selected Value"+p.get("rowIndexVal"));
  }


One can find a different other approaches here..
http://mjabr.wordpress.com/2011/03/19/reading-the-selected-value-of-a-select-list-in-java/
http://myadfnotebook.blogspot.com/2010/09/getting-string-value-or-item-code-of.html

5 comments:

  1. It was so nice article and useful to Informatica learners. we also provide oracle ADF course online training our Cubtraining is leader in providing Software Training

    ReplyDelete
  2. Hi,
    We are really grateful for your blog post. You will find a lot of approaches after visiting your post. Oracle Financials training
    Thank you.

    ReplyDelete
  3. How can we use same expression for MultiChoice

    #{row.bindings.LevelType.items[row.bindings.LevelType.inputValue].label}

    ??

    ReplyDelete
  4. Wonderful blog. Thanks for sharing informative Post. Its very useful to me.
    Oracle ADF Training in Hyderabad

    ReplyDelete
  5. Thank you so much for doing the impressive job here, everyone will surely like your post.
    full stack web development course malaysia

    ReplyDelete

Protected by Copyscape Unique Content Check