About Me

My photo
Dhaka, Dhaka, Bangladesh
✔4x Salesforce Certified ✔Web Application Developer ✔Database Developer with DWH/ETL/BI • Successful solution engineer and developer with 16+ years of experience multiple technology and in different countries. Proficient in implementing business requirements into the technical solution. Experience handling all phases of the project lifecycle from discovery through to deployment. Worked as technical lead for a team of junior developers to make sure code stayed in line with requirements and standard best practices. Skilled at integrating disparate systems with Salesforce.Experience implementing Salesforce Community Cloud at two previous companies.

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}"
required="#{bindings.RtNo.hints.mandatory}"
shortDesc="#{bindings.RtNo.hints.tooltip}"
autoSubmit="true"
valueChangeListener="#{Bn_global.Sone}">
<f:selectItems value="#{bindings.RtNo.items}"/>
</af:selectOneRadio>


Backing Bean

public void Sone(ValueChangeEvent valueChangeEvent) {

if(valueChangeEvent.getNewValue()!=null)
{

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

DCBindingContainer dcBindings =
(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();

// 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