Wednesday, August 7, 2019

Advance Table Column Format in OAF

Advance Table Column Format in OAF
Advance Table Column Format in OAF

Include this code in your controller:

Formatter formatter = new OADecimalValidater("#,##0.0000", "#,##0.0000");
OAAdvancedTableBean AdvTable1 =(OAAdvancedTableBean)webBean.findChildRecursive("AdvTable1");
OAColumnBean column3 = (OAColumnBean)AdvTable1.findIndexedChildRecursive("column3");
column3.setAttributeValue(ON_SUBMIT_VALIDATER_ATTR, formatter);

or you can also try with this code:

OAAdvancedTableBean tableBean = (OAAdvancedTableBean)webBean.findChildRecursive("AdvTable1");
if(tableBean != null){
OATableFooterBean footerBean = (OATableFooterBean) tableBean.getFooter();
System.out.println("footerBean : "+footerBean);
if (footerBean!= null){
OATotalRowBean totalRowBean = (OATotalRowBean)footerBean.findIndexedChild("totalRow1");
System.out.println("Formattotal : "+totalRowBean);
if (totalRowBean != null){
Formatter formatter = new OADecimalValidater("#,##0.00;(#,##0.00)","#,##0.00;(#,##0.00)");
totalRowBean.setAttributeValue(ON_SUBMIT_VALIDATER_ATTR, formatter);
}
}
}