Wednesday, August 4, 2010
Change color of particular field in table on particulate condition
Change color of particular field in table on particulate condition
Business requirement:
This is the particulate requirement which sometimes clients ask about this, mark the field in result table with different color if search condition match requirement or according to background process status change color of a field .
I did the following things to achieve above requirement
I just added below custom code to the Custom.xss file. You can find out this file in where you installed your J-developer .Path will look like this D:\JdeveloperR12\jdevhome\jdev\myhtml\OA_HTML\cabo\styles make sure file name’s first letter should be in capital .
_________________________________________________________
" !-- Please start your customizations here -->
'<'style selector=".Red"'>'
'<'property name="background-color"'>'#000000'<'/property'>'
'<'/style'>'
'<'style selector=".Yellow'>'
'<'property name="color"'>'#FFFF00'<'/property'>'
'<'/style'>'
_____________________________________________________________
In your VO query which brings result in table after search use decode as shown in below query
SELECT DECODE (lines.line_number
,1, 'Red'
) color
, lines.line_number
FROM apps.oe_order_lines_all lines
If line number is 1 it will mark background color as red
Next step is to bound the data value in controller
In processRequest write below code
public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
super.processRequest(pageContext, webBean);
OAMessageStyledTextBean comCode1 =
(OAMessageStyledTextBean)webBean.findChildRecursive("LineNumber");
OADataBoundValueViewObject css12 =
new OADataBoundValueViewObject(comCode1, "Color");
comCode1.setAttributeValue(oracle.cabo.ui.UIConstants.STYLE_CLASS_ATTR,
css12);
}
Subscribe to:
Posts (Atom)