Saturday, November 10, 2012

OAF:Set Text Color/Highlight record

Lets discuss on some of the common requirements in custom OAF pages

When ever there is a business validation failure display the content(text) in red color/other or mark the text.
This can be achieved by defining a custom css style.

CSSStyle cellBGColor = new CSSStyle();
#FF0000--red color
OAMessageStyledTextBean field12=(OAMessageStyledTextBean)webBean.findChildRecursive("field12");

if(field12 != null )


One more requirement was to set color for the records dynamically.
Once user select and submit a record in a advanced table
the region is refreshed and the selected row should be unchecked and record should be highlighted.

That mean when the page refreshes only certain record should be highlighted.

TO achieve this we create a transient attribute in the VO
based on our condition we set the value for it.

--Code in AM
--rowlineVo --row handler
--we try to use existing styles instead of defining new one

--Process request CO
OAMessageStyledTextBean field1 = (OAMessageStyledTextBean)webBean.findChildRecursive("Field1");
OADataBoundValueViewObject css2 = new OADataBoundValueViewObject(field1, "color");

This worked with out any issues..

If you want different colors based on the data we need to use OADataBoundValueViewObject.
OADataBoundValueViewObject css2 = new OADataBoundValueViewObject(field1, "color");

The first parameter the field which we want to apply the color and the second parameter is the vo attribute which need to be used.


Sherlyn Torbett said...

Thank you friend for sharing this oracle query

Sridevi Koduru said...
This comment has been removed by the author.
Joseph A. Wallace said...

Thanks for Information Oracle Apps Technical is a collection of a bunch of collected applications like accounts payables, purchasing, inventory, accounts receivables, human resources, order management, general ledger and fixed assets, etc which have its own functionality for serving the business.Oracle Apps Technical Online Training

Cub Training said...

Its impressive to know something about your note on Oracle apps Course. Please do share your articles like this your articles for our awareness. Mostly we do also provide Online Training on Cub training oracle apps course.

Sridevi Koduru said...
This comment has been removed by the author.
Sridevi Koduru said...

Sridevi Koduru (Senior Oracle Apps Trainer
LinkedIn profile -
Please Contact for One to One Online Training on Oracle Apps Technical, Financials, SCM, SQL, PL/SQL, D2K at | +91 - 9581017828.