Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Depending on what you need to do with the value one option is the following methods in your backing bean</p> <pre><code>public void valueChanged(ValueChangeEvent valueChangeEvent) { this.setValueToEL("#{bindings.Deptno.inputValue}", valueChangeEvent.getNewValue()); //Updates the model System.out.println("\n******** Selected Value: "+resolveExpression("#{bindings.Deptno.attributeValue}")); System.out.println("\n******** Display Value: "+resolveExpression("#{bindings.Deptno.selectedValue ne ' ' ? bindings.Deptno.selectedValue.attributeValues[1] : ''}")); } public Object resolveExpression(String el) { FacesContext facesContext = FacesContext.getCurrentInstance(); ELContext elContext = facesContext.getELContext(); ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory(); ValueExpression valueExp = expressionFactory.createValueExpression(elContext,el,Object.class); return valueExp.getValue(elContext); } public void setValueToEL(String el, Object val) { FacesContext facesContext = FacesContext.getCurrentInstance(); ELContext elContext = facesContext.getELContext(); ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory(); ValueExpression exp = expressionFactory.createValueExpression(elContext, el, Object.class); exp.setValue(elContext, val); } </code></pre> <p>and you JSP component should look like</p> <pre><code>&lt;af:selectOneChoice value="#{bindings.Deptno.inputValue}" label="Select Department" required="true" shortDesc="#{bindings.Deptno.hints.tooltip}" id="soc1" autoSubmit="true"&gt; &lt;f:selectItems value="#{bindings.Deptno.items}" id="si1"/&gt; &lt;/af:selectOneChoice&gt; </code></pre> <p>From <a href="http://blogs.oracle.com/adf/entry/getting_selected_value_from_selectonechoice" rel="nofollow">http://blogs.oracle.com/adf/entry/getting_selected_value_from_selectonechoice</a></p> <p>This will get you the displayed text in real time, if you're looking more for a connection to the view object backing the component you'll want to look at something like.</p> <pre><code>public void buttonPressed(ActionEvent actionEvent) { // Get the binding BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry(); // Get the sepecific list binding JUCtrlListBinding listBinding = (JUCtrlListBinding)bindings.get("DepartmentId"); // Get the value which is currently selected Object selectedValue = listBinding.getSelectedValue(); System.out.println(selectedValue); } </code></pre> <p>From <a href="http://blogs.oracle.com/shay/entry/getting_the_value_from_a_selec" rel="nofollow">http://blogs.oracle.com/shay/entry/getting_the_value_from_a_selec</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload