Monday, March 1, 2010

How to handle PPR events in Table regions in OA Framework

Hello all,

I have one table region where I am creating 6 rows by default. Now I have a requirement wherein after selecting one poplist, I want to fire a PPR event and disable that row. In this case we have to tell OAF which row to use. We achieve this using rowReference. If anyone have similar requirement, try to use below code or get back to me.

In controller class:

String event = pageContext.getParameter("
event");
if (("clause").equals(event)) {
// Get the identifier of the PPR event source row
String rowReference =
pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
Serializable[] parameters = { rowReference };
am.invokeMethod("nonEditable", parameters);
}

In Application Module:

public void nonEditable(String rowReference) {

try {
OAViewObject pVO = (OAViewObject) getXXBCR12TranslationVO1();

Row poRow[] = pVO.getAllRowsInRange();
OARow row = (OARow)findRowByRef(rowReference);

if ("ENDIF".equals(row.getAttribute("Condition"))|| "ELSE".equals(row.getAttribute("Condition")) ) {
row.setAttribute("transfielddisable", Boolean.TRUE);
System.out.println("disabling field");
}
} catch (Exception e) {

}
}