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();
}

About pacesettergraam

A good and realistic person

Posted on August 5, 2013, in OAF, Uncategorized and tagged , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: