Obtaining Row Reference from a radio Button
Create a row button on table region by select Selection When we click the radio Button a action will be fired. That we can obtain in CO and process in AM. This is very useful in Master Detail Relationship
Here we get a value by the radio Box check and we will pass to AM and we pass the obtained value to a VO as a param.
Code in CO to obtain the row reference
String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE); //Obtaining the Row Reference of the current Row
OAApplicationModule am1 =(OAApplicationModule) pageContext.getApplicationModule(webBean);
Serializable[] s={rowReference};// Sending the parameter thro a Serializable parameter
am1.invokeMethod(“obtainRow”, s);//invoking the Method in AM
Code in AM to process the row reference
public void obtainRow(String rowRef)
{
OAViewObject vo = (OAViewObject)getxxCustVO();
OARow row = (OARow)findRowByRef(rowRef); //Getting the rowRefence and getting as a row
System.out.println(“VO Current Row “+ vo.getCurrentRowIndex()+” “+row.getAttribute(“SelectFlag”));
if (row!=null)
{
System.out.println(row.getAttribute(“CustomerId”));
Number CustNum = (Number)row.getAttribute(“CustomerId”); //Obtaining Value from a Attribute and storing in a variable
// int CustNum = Integer.parseInt(custNum);
System.out.println(“VO getAttribute “+CustNum);
OAViewObject addrvo = (OAViewObject)getxxCustAddrVO();
addrvo.setWhereClause(“Customer_id = :1”);
addrvo.setWhereClauseParams(null);;
addrvo.setWhereClauseParam(0,CustNum);
addrvo.executeQuery();
}
Posted on August 5, 2013, in OAF & Forms, Uncategorized and tagged EVENT_SOURCE_ROW_REFERENCE, getting attribute, Obtaining Rows reference in OAF. Bookmark the permalink. 1 Comment.
I need to do the same functionality but not on radio button fire action rather on a separate “Update” button click event.
But in that case I am using this code, the very first line is returning me NULL value —
String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
And I have taken SelectFlag as a transient attribute to my VO which I have assigned to radioButton (Seingle Selection Bean).
In other way, if I am iterating my VO on click of “Update” button then VORowImpl.getSelectFlag() is also returning me a NULL value.
Will there be any work-around.?