Sep 24, 2019

Oracle Application Framework Developer and Personalization Guide

URL to find the OAF Developer and Personalization Guide for the version R12.2

Oracle Application Framework Developer Guide:

Oracle Application Framework Developer's Guide, Release 12.2.4 (Doc ID 1676216.1)




Oracle Application Framework Personalization Guide:

https://docs.oracle.com/cd/E26401_01/doc.122/e22031.pdf





Sep 23, 2019

Table Events | OAF Page

Table events are HTTP requests that are trapped and processed by OA Framework and handled during the processFormRequest phase.



1. EVENT_PARAM - indicates the event generated by a web bean (a table, in this case).


2. GOTO_EVENT - when 'Next' or 'Previous' navigation links are selected


3. SORT_EVENT - when a column header is selected to sort that column


4. HIDE_EVENT - when the 'Hide' link of a detail disclosure is selected


5. SHOW_EVENT - when the 'Show' link of a detail disclosure is selected


6. ADD_ROWS_EVENT - when the 'Add Another Row' button is selected


7. UPDATE_EVENT - when the total row 'Recalculate' button is selected


8. VALUE_PARAM - indicates a value that is relevant to a particular event: When a detail disclosure Hide/Show is selected, the value parameter contains the row index corresponding to the row whose Hide/Show was selected. When the 'Next' or 'Previous' link of table navigation bar is selected, the value parameter contains the index of the first row of the current range. For example, when the row range 1-10 is displayed, the value is 1 and when the row range 11-20 is displayed, the value is


9. SIZE_PARAM - indicates the number of rows currently displayed in the table (relevant only to the navigation event).


10. STATE_PARAM - indicates the current sort state (ascending or descending) of the column on which sorting is invoked (relevant only for the sort event).



Hide a mandatory field | OAF Page

If the business wants to hide a field in the seeded page, you can do it by personalizing the page and set Rendered property to false.
But this solution will not help you if the field is marked as mandatory by the seeded page.

The reasons are Mandatory Validations are usually done at the EO level. Hence even if you hide the mandatory field, the validation would still happen at the server. If the column has not null constraint in the table, it will throw a database error.


How to solve this ?

You can fix this by setting a default value for the mandatory field.

Extend the controller and set the value in the process Request() method. This is the safest way to default the value to the mandatory field.

After defaulting the mandatory variable, personalize the page and set the rendered property to false.

Hope it helps !!

Sep 4, 2019

OAF Date Field conversion to String using standard library SimpleDateFormat

In OAF if we create an attribute with DATE type then the value retained will be in the format of  yyyy-MM-dd hh:mm:ss.S

Ex: 2019-05-25 00:00:00.0



In order to convert the date format from yyyy-MM-dd hh:mm:ss.S to dd-MMM-yyyy, use the below piece of snippet.

Code to handle the Date Conversion:

import java.text.SimpleDateFormat;

    String convStr1=null;

OAMessageDateFieldBean  par1=(OAMessageDateFieldBean )webBean.findIndexedChildRecursive("crTargetFrom");             
                Timestamp TargetFrom = (Timestamp)par1.getValue(pageContext);

System.out.println("Target From :"+TargetFrom);

SimpleDateFormat format                = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.S");
SimpleDateFormat formatDate            = new SimpleDateFormat("dd-MMM-yyyy");

                try
                   {

                    java.util.Date dateStr1 = format.parse(TargetFrom.toString());

                    convStr1 = formatDate.format(dateStr1);

                                     
                    System.out.println("String date Converted : "+convStr1);

                    }
                 
                catch (Exception e)
                    {

                    System.out.println("String date exception "+e);

                    }

Aug 28, 2019

Microsoft Visual Basic Run-time error '1004': Method 'VBProject' of object '_Workbook' failed

To fix this issue, pls perform the below setups in MICROSOFT EXCEL to accept the WEBADI transaction in VBProject Workbook.


In Excel, use the following navigation:

Step 1: Open the Microsoft Excel and go to FILE à OPTIONS



Step 2: On the left, click on the Trust Center



Step 3: Click on the Trust Center Settings button and go to Macro Settings and Click on “Trust access to the VBA project object model



Aug 21, 2019

Throw Bundled Exception | OAF Page



  ArrayList bundle=new ArrayList();     //first we have to initialize the Array List

             
  if(empname.contains("@"))
                {
                bundle.add(new OABundleeption("Special character not allowed",OABundleeption.ERROR));
                }
  if("".equalsIgnoreCase(pageContext.getParameter("StartDate").trim()))
                {
                bundle.add(new OABundleeption("Start date shold not be null",OABundleeption.ERROR));
                }
  if(!bundle.isEmpty())
                {
                OABundleeption.raiseBundledOABundleeption(bundle);
                }
                }

List all the Parameter names and values | OAF Page



import java.util.Enumeration; 

Enumeration enums = pageContext.getParameterNames(); 
 while(enums.hasMoreElements())
{ 
   String paramName = enums.nextElement().toString(); 
   System.out.println("Param name:-->" +paramName+ ";Value:-->"+pageContext.getParameter(paramName)); 
 }



Useful Workflow Commands

  WFLOAD apps/columbus789 0 Y DOWNLOAD APEXP_FINDEV.wft APEXP Locations: $PO_TOP/patch/115/import/US/porpocha.wft $PO_TOP/patch/115/import/U...