I got many mails from user asking for code which can be refer to make DFF bean required dynamically.
Here is the link:
https://community.oracle.com/thread/1124874
Thx,
Anil
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
if(pageContext.getSessionValue("ApplyTotal")!=null) {
setTotal(pageContext.getSessionValue("ApplyTotal").toString(),pageContext,webBean) ; // Calling setTotal method to set the updated total value in Total Bean.
}
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
if("updateTotal".equals(pageContext.getParameter(EVENT_PARAM))) //Total event fired
{
OAViewObject vo = (OAViewObject)am.findViewObject("XXCreditCardVO1");
Integer total = 0;
if(vo!=null){
vo.first();
while(vo.hasNext()) // Loop through VO rows
{
if(vo.getCurrentRow().getAttribute("BilledAmount")!=null)
total = total + Integer.parseInt(vo.getCurrentRow().getAttribute("BilledAmount").toString());
vo.next();
}
pageContext.putSessionValue("ApplyTotal",total); // Putting the value in session
pageContext.forwardImmediatelyToCurrentPage(null,true, "Y");
}
public void setTotal(String total, OAPageContext pageContext,OAWebBean webBean){
OAAdvancedTableBean tableBean = (OAAdvancedTableBean)webBean.findChildRecursive("
AdvTableRN");
if(tableBean != null)
{
OAColumnBean tableFooterBean = (OAColumnBean)tableBean.findChildRecursive("ReimbAmountClmn");
if (tableFooterBean != null)
{
OAMessageTextInputBean totalBean = (OAMessageTextInputBean)tableFooterBean.findChildRecursive("ReimbAmount");
if (totalBean != null)
{
String formattedTotal = total.toString();
totalBean.setAttributeValue(TABULAR_FUNCTION_VALUE_ATTR, formattedTotal);
}
}
}