Monday, June 1, 2009

usefull code to get new value of select one Radio by ValueChangeListener Bean

Hi , have tried to get selected new value of ADF Select one radio item and get it by below code.

selectOneRadio JSF code
Note: Make sure that autoSubmit = "true"
<af:selectOneRadio value="#{bindings.RtNo.inputValue}"
<f:selectItems value="#{bindings.RtNo.items}"/>

Backing Bean

public void Sone(ValueChangeEvent valueChangeEvent) {


//get NewValue Index and parse to integrer
int selectIndex = Integer.parseInt(valueChangeEvent.getNewValue().toString()) ;

DCBindingContainer dcBindings =

// Get a attribute value of the current row of iterator
DCIteratorBinding iterBind =
(DCIteratorBinding)dcBindings.get("VOUserBranchList1Iterator"); //VOUserBranchList1Iterator is iteration name what I used

//get row of current index
Row selectedRow =iterBind.getRowAtRangeIndex(selectIndex);

if (selectedRow != null)
//get Row value
Object selectValue = (String)selectedRow.getAttribute("RtNo"); //RtNo is AttributeName what I used

Thanks to Jdeveloper Forum .

No comments:

Post a Comment