Monday, 5 March 2012

Adding New Row to the Advanced Table in Programatical way

                               Adding New Row to the Advanced Table in Programatical way

Step 1: Create sample page

Step 2: Create one Advanced Table in that page

Step 3: Setup the required properties for the page

Step 4: Create on footer for the table, in that create one add table row button

Step 5:
Set the below properties to the Add Table Row button


                  Insert Rows Automatically : False

Step 6: Now in the process Request method add the below code
  public void processRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processRequest(pageContext, webBean);
    sampleAMImpl am = (sampleAMImpl)pageContext.getApplicationModule(webBean);
    am.invokeMethod("createInsert1");
    OAAdvancedTableBean tableBean = (OAAdvancedTableBean)webBean.findIndexedChildRecursive("AdvancedTableBean1");
    System.out.println("Advanced Table Bean id--->"+tableBean);
    OATableFooterBean footerBean = (OATableFooterBean)tableBean.getFooter();
    System.out.println("TableFooter bean-->"+footerBean);
    if(footerBean!=null)
    {
      OAAddTableRowBean addTableRowBean =  (OAAddTableRowBean)footerBean.findIndexedChild("addTableRow1");
      System.out.println("Add Table Row Bean id----->"+addTableRowBean);
      // Add 5 rows everytime add row button is clicked
      addTableRowBean.setText("Add 1 Rows");
      addTableRowBean.setRows(1);
      // Handle add row insertion yourself
      addTableRowBean.setAttributeValue(AUTO_INSERTION, Boolean.FALSE);
    }
  } 


Step 7:  In AMImpl Class write the below Code
     public void createInsert1()
  {
    OAViewObject vo =getInsertVO1();
    if (!vo.isPreparedForExecution())  
    {      
      vo.executeQuery();   
    }
   
  }


Step 8: Now in the process Form Request method add the below code
   public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);
     OAAdvancedTableBean tableBean = (OAAdvancedTableBean)webBean.findIndexedChildRecursive("AdvancedTableBean1");
     System.out.println("Advanced Table Bean id--->"+tableBean);
     OATableFooterBean footerBean = (OATableFooterBean)tableBean.getFooter();
     System.out.println("TableFooter bean-->"+footerBean);
     if(footerBean!=null)
     {
       OAAddTableRowBean addTableRowBean =  (OAAddTableRowBean)footerBean.findIndexedChild("addTableRow1");
       System.out.println("Add Table Row Bean id----->"+addTableRowBean);
       if ((tableBean.getName(pageContext).equals(pageContext.getParameter(SOURCE_PARAM))) && (ADD_ROWS_EVENT.equals(pageContext.getParameter(EVENT_PARAM))))
       {
       System.out.println("Add Another row is pressed");
       sampleAMImpl am = (sampleAMImpl)pageContext.getApplicationModule(webBean);
       am.invokeMethod("createAnotherRow1");
       System.out.println("Action over");
       }
     }


Step 9: In Am Impl Class write the below Code

   public void createAnotherRow1()
  {
    InsertVOImpl studVo = getInsertVO1();
    // StudentDetailsVOImpl studVo = getStudentVO1();
    System.out.println(" vo class statement");
    InsertVORowImpl studrow = (InsertVORowImpl)studVo.createRow();
    System.out.println(" vo row impl statement");
    studVo.last();
    System.out.println("vo.last method");
    studVo.next();
    System.out.println("vo.next method");
    studVo.insertRow(studrow); //'ABC' is HardCod value inserted based on the requirement in this example
    System.out.println("insert row method");
    studVo.setCurrentRow(studrow);
    System.out.println("current row method");
    studrow.setNewRowState(Row.STATUS_INITIALIZED);
    System.out.println("Initialized method");
  }


Step 10: Now Run the page and check the functionality of Add Another Row.


Add Anothre Row Functinaliy in declarative way

Step 1: Create sample page

Step 2: Create one Advanced Table in that page

Step 3: Setup the required properties for the page

Step 4: Create on footer for the table, in that create one add table row button

Step 5: Setup the below properties to the add table row
                
                   Add Rows Label : Add Another Row
                   Rows to add: 1
                   Insert Rows Automatically : True
Step 6: Create one Controllor class

Step 7: Now in the process Request method add the below code

                    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processRequest(pageContext, webBean);
    sampleAMImpl am = (sampleAMImpl)pageContext.getApplicationModule(webBean);
    am.invokeMethod("createInsert");
  }

Step 8: In AMImpl Class write the below Code
   
 public void createInsert()
  {
    OAViewObject vo =getInsertVO1();
       if (!vo.isPreparedForExecution())  
    {      
      vo.executeQuery();   
    }
 }

Partial page renderin in oaf(PPR)

OAF : Partial Page Rendering : PPR

How to Implement PPR into OAF ?

${oa.ABCPVO1.NeelmaniRender} // Set this value for RENDER attribute of the UI Component


Put the below code into ProcessFormRequest
------------------------------------------------------

if ("entityPoplistChange".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
{
String entitypoplist=pageContext.getParameter("Entitypoplist");
Serializable[] param = {entitypoplist};
am.invokeMethod("handlePositionChangeEvent", param);
}

Put the below code into xxxAMImpl.java
------------------------------------------------

public void handlePositionChangeEvent(String param)
{
OAViewObject vo = (OAViewObject)findViewObject("ABCPVO1");
OARow row = (OARow)vo.first();

if(s.equals("param"))
{
row.setAttribute("NeelmaniRender", Boolean.TRUE);
row.setAttribute("JaiswalRender", Boolean.FALSE);
}
else
{
row.setAttribute("JaiswalRender", Boolean.TRUE);
row.setAttribute("NeelmaniRender", Boolean.FALSE);
}
}

Thursday, 1 March 2012

Using CSS Class in OAF displaying the message in UpperCase

Scenario: Using Css Class print the message in Upper case

Step 1: In process Request Method
       
          public void processRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processRequest(pageContext, webBean);
    CSSStyle cssName = new CSSStyle();
    cssName.setProperty("text-transform","uppercase");
    OAMessageTextInputBean mtib = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("Hello");
    if(mtib!=null)
    {
      mtib.setInlineStyle(cssName);
      mtib.setText(pageContext,"Hello Hai");
    }
   
}

Step 2: Run the page


  ******************************

Using the following code you may see the message in upper case, it may help you...

Step 1: go to styles folder in

C:\JDEV_12_1_1\jdevhome\jdev\myhtml\OA_HTML\cabo\styles

Step 2: Open the custom.css file

Step 3: Add the following code

<style selector= "XXOraUpperText">
<property name = "font:-family">Arial,Helvetica,Geneva,sans-seri</property>
<property name = "font:-weight">normal</property>
<property name = "font:-size">9pt</property>
<property name = "color">#797979</property>
<property name = "margin-bottom">0px</property>
<property name = "text-transform">uppercase</property>
</style>

Step 4: set the css property to the corrosponding item
name as XXOraUpperText

Tuesday, 21 February 2012

To Identify the Correct Jdeveloper for the Oracle EBS

To identify the correct jdeveloper to use do the following

1. Login to your Oracle Applications.
2. Select "About the Page" link in the bottom of the page
3. choose "Technology component part" Tab and note down the OA framework version.

Now login to metalink and check the following URL to identify the correct jdeveloper version for that instance.
https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=416708.1
or

https://support.oracle.com/CSP/ui/flash.html#tab=KBHome(page=KBHome&id=()),(page=KBNavigator&id=(bmDocID=416708.1&from=BOOKMARK&bmDocDsrc=KB&viewingMode=1143))

Downloading the Patch File from the Metalink..for Jdeveloper

To download the required patch file to work with jdeveloper in oracle applications, need to follow the below steps.

To download it from MetaLink(http://www.support.oracle.com/)

Here i was explained the sample patch file4960210, which is about 10.1.2.2 jdeveloper.
  1. click Patches & Updates
  2. click Simple Search hyperlink
  3. select Product or Family from the Search By list
  4. enter Oracle Application Server Products Family
  5. select the Release iAS 10.1.2.2 from the list
  6. select Patchset/MiniPack from the Patch Type list
  7. select your Platform: Microsoft Windows (32 bits) or Solaris Operating System (SPARC 64 bit)
  8. click the View Readme button and follow instructions
Alternatively, you can download by Patch Number: 4960210