You can add transient attribute to view object progmatically at run time.
You can use this transient attribute to store any temporary data for every row in view object or create generic solution in your custom framework for general purpose.
I will check existence of attribute XXAttr, If it is not exist I will add it to view object
pre.CICodeFormatter{ font-family:arial; font-size:12px; border:1px dashed #CCCCCC; width:99%; height:auto; overflow:auto; background:#f0f0f0; line-height:20px; padding:0px; color:#000000; text-align:left; } pre.CICodeFormatter code{ color:#000000; word-wrap:normal; }
You can use this transient attribute to store any temporary data for every row in view object or create generic solution in your custom framework for general purpose.
ADF
in ?ADF you can use below code anywhere in ApplicationModuleImpl classI will check existence of attribute XXAttr, If it is not exist I will add it to view object
ViewObject vo = this.findViewObject("ViewObjectName");
if (vo != null) {
try {
String transientAttr = vo.findAttributeDef("XXAttr").toString();
} catch (Exception e) {
vo.addDynamicAttribute("XXAttr");
}
}
OAF
Same like sample in ADF I will check existence of attribute XXAttr, If it is not exist I will add it to view objectpre.CICodeFormatter{ font-family:arial; font-size:12px; border:1px dashed #CCCCCC; width:99%; height:auto; overflow:auto; background:#f0f0f0; line-height:20px; padding:0px; color:#000000; text-align:left; } pre.CICodeFormatter code{ color:#000000; word-wrap:normal; }
public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
super.processRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
OAViewObject vo = (OAViewObject)am.findViewObject("ViewObjectName");
if (vo != null) {
try {
String transientAttr =
vo.findAttributeDef("XXAttr").toString();
} catch (Exception e) {
vo.addDynamicAttribute("XXAttr");
}
}
}