Monday 13 May 2013

Create Items Programetically

If You want to Create Any Item Or Region Dynamically Code Has to be written In Only Process request.These Items Doesn't Appear in the Structure Pane.

    OAStackLayoutBean oastacklayoutbean=(OAStackLayoutBean)webBean.findIndexedChildRecursive("region2"); // Initialization of StackLayout

    OAMessageTextInputBean oamessagetextinputbean=(OAMessageTextInputBean)createWebBean(pageContext,OAWebBeanConstants.MESSAGE_TEXT_INPUT_BEAN,null,"XX");
  
/*Creation MessagetextInputBean And Setting Prompt */

oamessagetextinputbean.setPrompt("YY");
    oastacklayoutbean.addIndexedChild(oamessagetextinputbean);// adding item to the StackLayout
    OAMessageCheckBoxBean oamessagecheckboxbean=(OAMessageCheckBoxBean)createWebBean(pageContext,OAWebBeanConstants.MESSAGE_CHECKBOX_BEAN,null,"YY");
   
    oastacklayoutbean.addIndexedChild(oamessagecheckboxbean);

Saturday 11 May 2013

Color The Item Based On Employee Position in Advanced table


Step 1:
Create EO Based VO i.e,EMPVO
SELECT EMPEo.EMPNO,
       EMPEo.ENAME,
       EMPEo.JOB,
       EMPEo.MGR,
       EMPEo.HIREDATE,
       EMPEo.SAL,
       EMPEo.COMM,
       EMPEo.DEPTNO,
       EMPEo.CREATION_DATE,
       EMPEo.CREATED_BY,
       EMPEo.LAST_UPDATE_DATE,
       EMPEo.LAST_UPDATE_LOGIN,
       EMPEo.LAST_UPDATED_BY,
       EMPEo.ROWID,DECODE (EMPEo.JOB
,'MANAGER', '1','2'
) color
FROM EMP EMPEo

Step 2:Under Custom.xss

add Follwing code
<style name="For_Bold">
<property name="font-weight">bold</property>
<property name="font-size">10pt</property>
</style>

<style selector=".1">
<includeStyle name="DefaultFamily"/>
<property name="font-size">11pt</property>
<property name="font-weight">Bolder</property>
<property name="color">#FFFF00</property>
<property name="text-indent">3px</property>
<property name="background-color">#FF0000</property>
</style>

<style selector=".2">
<includeStyle name="DefaultFontFamily"/>
<property name="font-size">11pt</property>
<property name="font-weight">Bolder</property>
<property name="color">#FFFF00</property>
<property name="text-indent">3px</property>
<property name="background-color">#003399</property>
</style>


the path of the custom.xss is in $OA_HTML/cabo/Styles/custom.xss


Under Process Request:
    OAApplicationModule am=( OAApplicationModule)       pageContext.getApplicationModule(webBean);
    EMPVOImpl vo=am.getEMPVO1();
    vo.executeQuery();
    OAAdvancedTableBean table = (OAAdvancedTableBean)webBean.
    findIndexedChildRecursive("region2");
    OAColumnBean ejobcol = (OAColumnBean)webBean.
    findIndexedChildRecursive("column1");
    OAMessageTextInputBean job = (OAMessageTextInputBean)ejobcol.
    findIndexedChildRecursive("item1");--for which item you wanted color
    OADataBoundValueViewObject cssjob = new OADataBoundValueViewObject(job,"Color");
    job.setAttributeValue(oracle.cabo.ui.UIConstants.STYLE_CLASS_ATTR, cssjob);


O/P will be like: