Friday, June 9, 2017

WHEN-VALIDATE-RECORD WHEN-VALIDATE-ITEM triggers in OAF

I was recently helping a friend in a customization in OAF, where through personalization, he wanted to put a ppr action in a seeded page in a seeded item. He was trying to do that customization using fire action, which was not acceptable by customer due to obvious reasons. Since, I think this section is missing in developers' guide, and is quite simple to approach, here is code you can write in process request of CO to attach programmatic PPR. lets take a simple example of attaching PPR to a message choice bean :

//In Process Request() 
{
//Please attach PPR only to those UIX beans which support it
//otherwise it may not work
OAMessageChoiceBean mcb=(OAMessageChoiceBean)webBean.findChildRecursive("");
FireAction firePartialAction = new FirePartialAction("empPositionChange");
mcb.setAttributeValue(PRIMARY_CLIENT_ACTION_ATTR,firePartialAction);
}

//In process form request
if ("empPositionChange".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
{
//ur logic on PPR

//if PPR is attached in a table/hgrid child then we can find the row
//reference by
String rowReference =pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
}



or

OAMessageTextInputBean SupplierItem_Bean = (OAMessageTextInputBean)webBean.findChildRecursive("SupplierItem");
FireAction firepartialaction = new FireAction("Supplier_Item_Change");
SupplierItem_Bean.setAttributeValue(PRIMARY_CLIENT_ACTION_ATTR, firepartialaction);
pageContext.writeDiagnostics(this, "About to set partial action for Supplier Item ", OAFwkConstants.STATEMENT);


I hope this helps. Happy oaf extensions :)!


courtasy - http://mukx.blogspot.in/2009/12/programatic-ppr-in-oaf.html