Making field read only - OAF
I have a requirement to restrict 'Supplier Name'(in supplier entry page) from update if attribute10 is null.
I have extended CO by including the condition,
OAViewObject VendorVo = (OAViewObject)am.findViewObject("SupplierVO");
OAViewObject VendorVo1 = (OAViewObject)am.findViewObject("SupplierVO");
Row VenRow = (Row)VendorVo.getCurrentRow();
Row VenRow1 = (Row)VendorVo1.getCurrentRow();
if(VenRow1 !=null){
entityId = (String)VenRow1.getAttribute("Attribute10");
paramOAPageContext.writeDiagnostics(this, "Attribute10 : entityId ", +entityId); //26078
if(entityId!=null){
paramOAPageContext.writeDiagnostics(this, "Attribute10 : entityId ", +entityId);
throw new OAException("entityId: "+entityId , OAException.ERROR);
((OAMessageTextInputBean)webBean.findIndexedChildRecursive("VendorName")).setReadOnly(true);
}
}
This restricts the supplier name from update , but at the same time, it does not let me save any change incase attribute10 is not null.