Showing posts with label OAF. Show all posts
Showing posts with label OAF. Show all posts

Thursday, July 28, 2016

Set custom CSS (Colors) for specific fields in OAF

In Controller ProcessRequst Method():

OAMessageTextInputBean textBean = (OAMessageTextInputBean)oawebbean.findIndexedChildRecursive("Amount");
textBean.setAttributeValue(oracle.cabo.ui.UIConstants.STYLE_CLASS_ATTR, "xx_CSS_property_name");

Set two decimal to Number fields in OAF

In Controller ProcessRequest() method:

OAMessageTextInputBean Baseline_END_DATE7 = (OAMessageTextInputBean)oawebbean.findIndexedChildRecursive("xxAmount");
Baseline_END_DATE7.setAttributeValue(OAWebBeanConstants.CURRENCY_CODE,"USD" );

Dependent MessageChoice in OAF Table Region

Dependent Pick List VO query like:

select unique UOM_CODE lookup_code ,xx_code from xx.xx_tbl
where xx_code = :1

In Controller PR method:

    OAAdvancedTableBean  tableBean

      (OAAdvancedTableBean)oawebbean.findIndexedChildRecursive("ConstAreaDtlsTable");
        OAMessageChoiceBean k = (OAMessageChoiceBean)oawebbean.findIndexedChildRecursive("choiceList");
        k.setListVOBoundContainerColumn(0, tableBean,"DepColvalue1");
        k.setListVOBoundContainerColumn(1, tableBean,"DepColvalue2");
        k.setPickListCacheEnabled(false);                 

//  "DepColvalue1","DepColvalue2" are the Item ID in the page Structure and the choice list query execute based on these values for each row in Table Region Dynamically.
       

Some Examples for above:

OAMessageChoiceBean k1 = (OAMessageChoiceBean)oawebbean.findIndexedChildRecursive(“Applicable1″);
k1.setListVOBoundContainerColumn(0, tableBean2,”ProgramId1″);
k1.setListVOBoundContainerColumn(1, tableBean2,”ConstareaId”);
// k1.setListVOBoundContainerColumn(1, tableBean2,”SaleableareaId”);
k1.setPickListCacheEnabled(false);

OAMessageChoiceBean k3 = (OAMessageChoiceBean)oawebbean.findIndexedChildRecursive(“BudgetCodeFlexValue”);
k3.setListVOBoundContainerColumn(0, tableBean,”BudCodeFlex”);
k3.setPickListCacheEnabled(false);

OAMessageChoiceBean k4 = (OAMessageChoiceBean)oawebbean.findIndexedChildRecursive(“BudgetCodeFlexValue1″);
k4.setListVOBoundContainerColumn(0, tableBean2,”BudCodeFlex1”);
k4.setPickListCacheEnabled(false);

Capture LOV Event in OAF


— In CO ProcessformRequest Method:

if (pageContext.isLovEvent())
{
String lovInputSourceId = pageContext.getLovInputSourceId();
if(“xx_name”.equals(lovInputSourceId))
{
OAMessageLovInputBean lovBean=(OAMessageLovInputBean)webBean.findIndexedChildRecursive(lovInputSourceId);
if(lovBean != null)
{
String lovInput = (String) lovBean.getValue(pageContext);
System.out.println(“–lovInput –“+lovInput);
}
}