Saturday, March 5, 2016

Default Filter Value in af:table Filter

When we Enable Sorting and Filtering and need to Default value in Filter for First or each time ,
create bean with table handle

public class MyBean {
    public MyBean() {
public FilterableQueryDescriptor getCustomQueryDescriptor() {
        String bindingEl = "#{bindings.MyVO1Query}";

        FacesCtrlSearchBinding sbinding =
        FilterableQueryDescriptor fqd =
        if (fqd != null &&
            fqd.getConjunctionCriterion() != null  && isInitialQuery()) {
            ConjunctionCriterion cc = fqd.getConjunctionCriterion();
            List<Criterion> lc = cc.getCriterionList();
            for (Criterion c : lc) {
                if (c instanceof AttributeCriterion) {
                    AttributeCriterion ac = (AttributeCriterion)c;
                    if ((ac.getAttribute().getName().equalsIgnoreCase("Status")) &&
                        ac.getValues().isEmpty()) { 
                        Map filterCriteria = fqd.getFilterCriteria();
                        if (filterCriteria == null) {
                            filterCriteria = new HashMap<String, Object>();
                        filterCriteria.put("Status", "PENDING");
            RichTable tbl = getMyTable();
            QueryEvent queryEvent = new QueryEvent(tbl, fqd);
        return fqd;


Change af:table property


Monday, January 25, 2016

JDeveloper Could not reserve enough space for object heap

While Running Integrated Weblogic Server instance got Error

C:\Oracle\MIDDLE~1\JDK160~1\bin\java -client   -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=128m  -XX:MaxPermSize=512m -Dweblogic.Name=DefaultServer\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.policy\Oracle\Middleware\wlserver_10.3\server\lib\DemoTrust.jks -Doracle.jdeveloper.adrs=true -Dweblogic.nodemanager.ServiceEnabled=true  -Xverify:none  -da -Dplatform.home=C:\Oracle\MIDDLE~1\WLSERV~1.3 -Dwls.home=C:\Oracle\MIDDLE~1\WLSERV~1.3\server -Dweblogic.home=C:\Oracle\MIDDLE~1\WLSERV~1.3\server -Dcommon.components.home=C:\Oracle\MIDDLE~1\ORACLE~1 -Djrf.version=11.1.1 -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger -Ddomain.home=C:\Users\jeet\AppData\Roaming\JDEVEL~1\SYSTEM~1.93\DEFAUL~1 -Djrockit.optfile=C:\Oracle\MIDDLE~1\ORACLE~1\modules\oracle.jrf_11.1.1\jrocket_optfile.txt -Doracle.server.config.dir=C:\Users\jeet\AppData\Roaming\JDEVEL~1\SYSTEM~1.93\DEFAUL~1\config\FMWCON~1\servers\DefaultServer -Doracle.domain.config.dir=C:\Users\jeet\AppData\Roaming\JDEVEL~1\SYSTEM~1.93\DEFAUL~1\config\FMWCON~1  -Digf.arisidbeans.carmlloc=C:\Users\jeet\AppData\Roaming\JDEVEL~1\SYSTEM~1.93\DEFAUL~1\config\FMWCON~1\carml  -Digf.arisidstack.home=C:\Users\jeet\AppData\Roaming\JDEVEL~1\SYSTEM~1.93\DEFAUL~1\config\FMWCON~1\arisidprovider\Users\jeet\AppData\Roaming\JDEVEL~1\SYSTEM~1.93\DEFAUL~1\config\fmwconfig\jps-config.xml\Users\jeet\AppData\Roaming\JDEVEL~1\SYSTEM~1.93\DEFAUL~1\servers\DefaultServer\tmp\_WL_user\- -Dweblogic.alternateTypesDirectory=C:\Oracle\MIDDLE~1\ORACLE~1\modules\oracle.ossoiap_11.1.1,C:\Oracle\MIDDLE~1\ORACLE~1\modules\oracle.oamprovider_11.1.1,C:\Oracle\MIDDLE~1\ORACLE~1\modules\oracle.jps_11.1.1  -Dweblogic.jdbc.remoteEnabled=false -Dwsm.repository.path=C:\Users\jeet\AppData\Roaming\JDEVEL~1\SYSTEM~1.93\DEFAUL~1\oracle\store\gmds  -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=C:\Oracle\MIDDLE~1\patch_wls1035\profiles\default\sysext_manifest_classpath;C:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\sysext_manifest_classpath  weblogic.Server

Error occurred during initialization of VMCould not reserve enough space for object heapCould not create the Java virtual machine.

Process exited.

1)Download - jdk-6u45-windows-x64.exe and install it.
2)After installation it creates folder C:\Program Files\Java\jdk1.6.0_45
3)Need to update this path in two files.
eg. C:\Oracle\Middleware\jdeveloper\jdev\bin
#SetJavaHome C:\Oracle\Middleware\jdk160_24
SetJavaHome C:\Program Files\Java\jdk1.6.0_45

set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_45

References :-

Wednesday, February 4, 2015

ADF Skins

Fusion Dev Guide

Customizing Appearance using Skins

The directory path to the XML schemas is similar to the following:

1)Create mySkin.css under skins/mySkin/mySkin.css
2)Create below file under WEB-INF dir
------  trinidad-skins.css

<?xml version="1.0" encoding="UTF-8" ?>
<skins xmlns="">
3)------  trinidad-config.css

<?xml version="1.0" encoding="windows-1252"?>
<trinidad-config xmlns="">

To Refresh skin files
****   If you changed extends in trinidad-skins.css  eg.
<extends>skyros-v1.desktop</extends>   to <extends>fusion.desktop</extends>

To affect changes on actual jspx or jsff
just swap <skin-family>mySkin</skin-family>   to  <skin-family>skyros</skin-family>
and again back to  

Skinning only for One Component

Sunday, September 7, 2014

ADF Exception Handling

Custom Exception Handlers can be used to suppress or alter exception reporting.

1. Model Layer

Extending  DCErrorHandlerImpl.

1.Create class by extending DCErrorHandlerImpl.
2.Update DataBindings.cpx
<Application xmlns="" version="" id="DataBindings"
             SeparateXMLFiles="false" Package="view" ClientType="Generic"
3. Handle,Extend or Skip Exceptions by overriding method
    public void reportException(DCBindingContainer dCBindingContainer,
                                Exception exception)

Got error
oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.InstantiationException, msg=view.exception.MyCustDcExceptionHandler

    public MyCustDcExceptionHandler(boolean b) {
Change To
    public MyCustDcExceptionHandler() {

To customize known error message
public String getDisplayMessage(BindingContext ctx, Exception ex) {
String message="";
if (ex instanceof oracle.jbo.ValidationException) {
String msg = ex.getMessage();
int i=msg.indexOf("JBO-25013");//When JBO-25013 Too many object match primary key exception occur.
message= "Duplicate Employee Id Found.";
message= getDisplayMessage(ctx,ex);
return message;


2.Task Flow Exception Handler


Handling Exception at adfc-config

  public void handleExceptionShowMessageInPopupDialog() {

    ControllerContext cc = ControllerContext.getInstance();

    Exception ex = cc.getCurrentViewPort().getExceptionData();
    String message = ex.getMessage();

    FacesContext fc = FacesContext.getCurrentInstance();
    FacesMessage facesMessage =
      new FacesMessage(FacesMessage.SEVERITY_ERROR, "UTF: " + message, null);
    fc.addMessage(null, facesMessage);



3.Controller Exception Handler

1)Create a Java class that extends ExceptionHandler
2)Create folder .adf\META-INF\services and add file with the name Save with no extension.
Under .adf\META-INF\services File Type should be EXCEPTIONHANDLER File.
3)In the file, add the absolute name of your custom exception handler class (package name and class name without the “.class” extension)


ADF Errors

public static String accessExceptionStackTraceViaPrintWriter(final Throwable throwable)
      final Writer writer = new StringWriter();
      final PrintWriter printWriter = new PrintWriter(writer);
      return writer.toString();

Tuesday, April 9, 2013

ADF set Focus on Table Component

 Write Below piece of code in Action / ActionListener        

 //t1 -- Your Table Id
 //it1-- Your text component inside table
 FacesContext ctx = FacesContext.getCurrentInstance();
        String tableId = t1.getClientId(FacesContext.getCurrentInstance());
        String inputId = "";
        RowKeySet rks = t1.getSelectedRowKeys();
        if(rks != null && rks.size() > 0) {
            Object rowKey = rks.iterator().next();
            String rowId = t1.getClientRowKeyManager().getClientRowKey(FacesContext.getCurrentInstance(), t1, rowKey);
            inputId = tableId + ":" + rowId + ":" + "it1";
        //compose JavaScript to be executed on the client
        StringBuilder script = new StringBuilder();
        //use client id to ensure component is found if located in
        //naming container 
        script.append("var textInput = ");
        script.append ("('"+inputId+"');");
        script.append("if(textInput != null){");
        //invoke JavaScript

      public static void writeJavaScriptToClient(String script) {
        FacesContext fctx = FacesContext.getCurrentInstance();
        ExtendedRenderKitService erks = null;
        erks = Service.getRenderKitService(
                     fctx, ExtendedRenderKitService.class);
        erks.addScript(fctx, script);

Detail Explanation can be found at


Sunday, December 9, 2012

ADF Upload Blob File in Table Column

Create Table with Blob Column

create table xx_attachment(fileId Number, file_name VARCHAR2(255),
                                          file_content_type varchar2(100),file_data blob,
                                         CONSTRAINT xx_attach_pk PRIMARY KEY (fileId));

Create EO,VO add it to AM.

Create below variable and accessor inside Managed Bean or Backing Bean.

import org.apache.myfaces.trinidad.model.UploadedFile;
    private UploadedFile _file;   
    public UploadedFile getFile() {
        return _file;

    public void setFile(UploadedFile file) {
        _file = file;

On JSF Page(jspx/jsf) or Page Fragment(jsff)
1)From DataControl unde XxAttachmentVO1 --> Operations --> Drag CreateInsert method and drop as ADF Button.   (When you click this Button it creates Blank row).

2)From Common Components drag inputFile(af:inputFile) component and drop on page.
Make sure  you put value as  #{<yourMangedBean>.file}

<af:inputFile label="Upload File" id="if1"
3)From Common Components drag Button and drop after inputFile component.
Write below code on Button action Listner.

<af:commandButton text="Upload" id="cb11"

4)Add Commit action method in Bindings.

5)For Page Form make sure usesUpload property is True.
<af:form id="f1" usesUpload="true">

import oracle.adf.model.BindingContext;
import oracle.adf.model.binding.DCBindingContainer;
import oracle.adf.model.binding.DCIteratorBinding;

import oracle.binding.BindingContainer;
import oracle.binding.OperationBinding;

import oracle.jbo.Row;
import oracle.jbo.domain.BlobDomain;

import java.sql.SQLException;
import javax.faces.event.ActionEvent;
    public String uploadAttach() {
        // Add event code here...
        //BindingContainer bindings = (BindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
        UploadedFile myfile = (UploadedFile)this.getFile();
        BindingContext bindingctx = BindingContext.getCurrent();
        BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
        DCBindingContainer bindingsImpl = (DCBindingContainer)bindings;
        DCIteratorBinding iter = bindingsImpl.findIteratorBinding("XxAttachmentVO1Iterator");
        Row row = iter.getCurrentRow();
        // Upload File into Blob Column
        row.setAttribute("FileData", createBlobDomain(myfile));
        // File Name
        String fileName = (String)myfile.getFilename();
        row.setAttribute("FileName", fileName);
        // File Content/MIME Type
        String fileContentType = (String)myfile.getContentType();
        row.setAttribute("FileContentType", fileContentType);
        //Commit Transaction
        OperationBinding method = bindings.getOperationBinding("Commit"); 
        return null;

    private BlobDomain createBlobDomain(UploadedFile file) {
        InputStream in = null;
        BlobDomain blobDomain = null;
        OutputStream out = null;

        try {
            in = file.getInputStream();

            blobDomain = new BlobDomain();
            out = blobDomain.getBinaryOutputStream();
            byte[] buffer = new byte[8192];
            int bytesRead = 0;

            while ((bytesRead =, 0, 8192)) != -1) {
                out.write(buffer, 0, bytesRead);

        } catch (IOException e) {
        } catch (SQLException e) {

        return blobDomain;

To download file.

ADF Multi Select Options (af:selectMany)

ADF Code Corner

Create Master Detail Table
create table xx_users(user_id NUMBER,user_name VARCHAR2(100),
                                  CONSTRAINT xx_users_pk PRIMARY KEY (user_Id));
create table  xx_roles(role_id NUMBER,role_name VARCHAR2(100),
                                   CONSTRAINT xx_roles_pk PRIMARY KEY (role_Id));
Create EO,VO for above 2 tables.

create table xx_user_roles(user_role_id NUMBER,user_id NUMBER,role_name VARCHAR2(100),
                    CONSTRAINT xx_user_roles_pk PRIMARY KEY (user_role_Id),
                    CONSTRAINT xx_user_roles_fk1
                      FOREIGN KEY (user_id)
                      REFERENCES xx_users(user_id));
Create ReadOnly VO based on Above table.

Add All VO instances into AppModule.

From DataControl Add CreateInsert Operation for XxUsersVo1 as Button on Page.
From DataControl XxUsersVo1 as ADF Form.

From Data Control add XxRolesLOVVO1 as ADF Select Many Choice
              <af:selectManyChoice value="#{bindings.XxRolesLOVVO1.inputValue}"
                <f:selectItems value="#{bindings.XxRolesLOVVO1.items}"

On Button Pressed

    public void addRoles() {
        BindingContext bctx = BindingContext.getCurrent();
        BindingContainer bindings = bctx.getCurrentBindingsEntry();
        JUCtrlListBinding allRolesList =
                 (JUCtrlListBinding) bindings.get("XxRolesLOVVO1");
          Object[] selVals = allRolesList.getSelectedValues();
          for (int i = 0; i < selVals.length; i++) {
            //Integer val = (Integer)selVals[i];
            String val = (String)selVals[i];
              System.out.println("Int Val "+val);

             // Insert into Table after getting selected Rows or your Code
              OperationBinding crRoleMethod = bindings.getOperationBinding("CreateInsertRoles"); 
              DCBindingContainer bindingsImpl = (DCBindingContainer)bindings;
              DCIteratorBinding iter = bindingsImpl.findIteratorBinding("XxUserRolesVO2Iterator");

              Row row = iter.getCurrentRow();
              // Insert Role Name
              row.setAttribute("RoleName",val );

Use if you want to pull records based on Indices

    public void addRolesUsingIndices() {
        BindingContext bctx = BindingContext.getCurrent();
        BindingContainer bindings = bctx.getCurrentBindingsEntry();
        JUCtrlListBinding allRolesList =
                 (JUCtrlListBinding) bindings.get("XxRolesLOVVO1");
           int[] selVals = allRolesList.getSelectedIndices();
          for (int indx : selVals ) {
                  Row rw = allRolesList.getRowAtRangeIndex(indx);
                  Number id  = (Number)rw.getAttribute("RoleId");
                  String val = (String)rw.getAttribute("RoleName");
               // Insert into Table after getting selected Rows  or your Code
               OperationBinding crRoleMethod = bindings.getOperationBinding("CreateInsertRoles"); 
              DCBindingContainer bindingsImpl = (DCBindingContainer)bindings;
              DCIteratorBinding iter = bindingsImpl.findIteratorBinding("XxUserRolesVO2Iterator");
              Row row = iter.getCurrentRow();
              // Insert Role Name
              row.setAttribute("RoleName",id+" "+val );

If the Choice List is Static eg.
            <af:selectManyCheckbox label="Roles" id="smc1"
              <af:selectItem label="Accountant" value="ACCOUNTANT" id="si3"
              <af:selectItem label="Sales Manager" value="SALES_MANAGER"
              <af:selectItem label="Finance Manager" value="FINANCE_MANAGER"
              <af:selectItem label="Buyer" value="BUYER" id="si4"

Add below method call on Button Pressed


Add below code in Managed Bean or Backing Bean

    private Object[] listValue;
    public void setListValue(Object[] listvalue){
        this.listValue = listvalue;
    public Object[] getListValue(){
        return listValue;
    public String getListString(){
        return createString(listValue);
    public String createString(Object[] arr){
        if(arr != null){
            String values = "[";
            for(int i=0;i<arr.length;i++) {
                values = values + arr[i];
                if (i <arr.length - 1)
                values = values + ",";
        values = values + "]";
        return values;
        return null;

    public void addRoles(Object[] arr){
         BindingContext bindingctx = BindingContext.getCurrent();
         BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
        if(arr != null){
            //String values = "[";
            for(int i=0;i<arr.length;i++) {
                //values = values + arr[i];
                System.out.println("Roles to be added "+arr[i]);
                    // Insert Row into USer Roles table
                    OperationBinding crRoleMethod = bindings.getOperationBinding("CreateInsertRoles"); 
                    DCBindingContainer bindingsImpl = (DCBindingContainer)bindings;
                    DCIteratorBinding iter = bindingsImpl.findIteratorBinding("XxUserRolesVO2Iterator");
                    Row row = iter.getCurrentRow();
                    // Insert Role Name
                    row.setAttribute("RoleName",arr[i] );
                //if (i <arr.length - 1)
                //values = values + ",";
        //values = values + "]";


Monday, November 5, 2012

R12 SLA Tables

 Oracle Sub Ledger accounting (SLA) is accounting hub in Oracle Application Release 12 (R12). It is used to derive all attributes required to account a transaction in Oracle General Ledger. In R12, SLA is used to derive the very basic accounting attributes like entered amount, accounted amount, Date, Currency code etc and the complex attributes like Ledger, Code Combination ID, Periods etc. After deriving these accounting attributes the transactions are then interfaced to GL from SLA. Thus in R12 no sub ledgers (AP, PO, PA etc) interfaces the transactions directly to GL, but all the transactions are interfaced to GL in following 2 steps:
1. Sub ledgers interface the data to SLA.
2. SLA derives the accounting information and interfaces the data to GL.

SLA gives the flexibility to manage the entire accounting rule at one place, which acts as a single source of truth for GL.

Run Create Accounting to Populate Accounting events (SLA)  tables. After running Creating Accounting user can view Accounting.

Key Tables for SLA



-- Mapping Identifiers
--Menu: Setup > Subledger Accounting > Accounting Methods Builder > Events > Event Modal
--Entity Code                     Column Value                                Column in xla_transaction_entities
--REVENUE                      PROJECT_ID                                SOURCE_ID_INT_1
--REVENUE                      DRAFT_REVENUE_NUM          SOURCE_ID_INT_2
--AP_INVOICES               INVOICE_ID                                SOURCE_ID_INT_1
--AP_PAYMENTS            CHECK_ID                                   SOURCE_ID_INT_1

Taking the example of Oracle Projects in 11i where after costing the transaction user need to run the ‘PRC: Interface Cost to General Ledger’ followed by ‘Journal Import’ followed by ‘PRC: Tieback process’. But in R12 user only need to run “PRC: Generate Cost Accounting Events” which will register events in SLA and thereafter SLA will take care of accounting the transaction and interfacing it to GL. There is no tieback process in R12, as there is one to one reference of event id between SLA and sub ledger tables.

Other Oracle Table Information!/2012/06/apps-tables-with-links.html


R12 Error while running
PRC: Create Accounting
The application accounting definition Projects Standard Accounting owned by Oracle is not validated.  Please validate the application accounting definition or update the application accounting definitions contained in the subledger accounting method Standard Accrual.
Run Program
Validate Application Accounting Definitions with Ledger and Application Details.

Transaction data not found in XLA_TRANSACTION_ENTITIES

Query useing xla.xla_transaction_entities

exec fnd_global.apps_initialize(11787,20707,201);
exec mo_global.init ('PO');

Oracle Apps GL Base Table and Interface Table
GL_JE_HEADERS                      GL_INTERFACE
GL_JE_LINES                             GL_INTERFACE_HISTORY


Oracle Apps  :  Link between GL to Subledger Account

GL_JE_BATCHES (je_batch_id)                                   => GL_JE_HEADERS (je_batch_id)

GL_JE_HEADERS (je_header_id)                                  => GL_JE_LINES (je_header_id)

GL_JE_LINES (je_header_id,  je_line_num)                      => GL_IMPORT_REFERENCES (je_header_id, je_line_num)

GL_IMPORT_REFERENCES (gl_sl_link_table, gl_sl_link_id)        => XLA_AE_LINES (gl_sl_link_table, gl_sl_link_id)

XLA_AE_LINES (application_id, ae_header_id)                   => XLA_AE_HEADERS (application_id, ae_header_id) 

XLA_AE_HEADERS (application_id, event_id)                     => XLA_EVENTS (application_id, event_id)  

XLA_EVENTS (application_id, entity_id)                        => XLA.XLA_TRANSACTION_ENTITIES 

Thursday, November 1, 2012

ADF Generic Code and Information

ADF Blogs


Some WebCenter blogs with good ADF related content:
WebCenter A-Team -
John Brunswick -
George Maggessy -
And of course Frank Nimphius Code Corner



Oracle Demo Page

Backing Bean Handy Codes

ADF with OAF

ADF get Current Row Attribute Value
import oracle.adf.model.BindingContext;
import oracle.adf.model.binding.DCBindingContainer;
import oracle.adf.model.binding.DCIteratorBinding;
import oracle.jbo.domain.Number;
        DCBindingContainer dcBindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry(); 
        DCIteratorBinding iterBind= (DCIteratorBinding)dcBindings.get("XxTestStgVO1Iterator"); 
        Number attItemId = (Number)iterBind.getCurrentRow().getAttribute("ItemId");

Accessing Data Controls and Bindings

Access AM
DCBindingContainer bc = getBindingContainer();
MyAppModule myAM =

Getting Attribute from Iterator Binding
DCBindingContainer bc = getBindingContainer();
String ename = (String)bc.findIteratorBinding("EmpIter").getCurrentRow().getAttribute("EName");

Access Binding Container with Convenience API
BindingContainer  bc = BindingContext.getCurrent().getCurrentBindingEntry();

Programmatic Commit
import oracle.adf.model.BindingContext;
import oracle.binding.BindingContainer;
import oracle.binding.OperationBinding;
        BindingContext bindingContext = BindingContext.getCurrent();
        BindingContainer bindings = bindingContext.getCurrentBindingsEntry();
        OperationBinding commitOper = (OperationBinding) bindings.get("Commit");

Alternate Keys

How to programmatically access ADF binding values
FacesContext fctx = FacesContext.getCurrentInstance();
ELContext elctx = fctx.getELContext();
Application application = fctx.getApplication();
ExpressionFactory exprFactory = application.getExpressionFactory();
ValueExpression valueExpr = exprFactory.createValueExpression( elctx, "#{bindings.DepartmentId.inputValue}", Object.class);
oracle.jbo.domain.Number departmentId = null;
departmentId = (oracle.jbo.domain.Number) valueExpr.getValue(elctx);


1)Create LOVVO or ViewCriteria for MasterLookup table depending on your condition.
2)Open VO and its attribute on which you want to create List Of Values. Click on List of Values -> Add. It will open Form and default List Of Values name.
a)In Configuration Enter ListDataSource as LOV VO or ViewAccessor or Master Lookup TableVO.
   In case of MasterLookupTableVO after adding DataSource click edit to add ViewCriteria.
b)Mention ListAttribute name.
3)In UI Hints you can add Meaning or Description columns.

ADF Set on Current row after Rollback Execute or page refresh
DCIteratorBinding Iter = (DCIteratorBinding)bindings.get("<YourIteratorName>");
Key parentKey = Iter.getCurrentRow().getKey();
BindingContainer binding = getBindings();
OperationBinding RollbackBdg = binding.getOperationBinding("Rollback");
OperationBinding ExcBdg  = binding.getOperationBinding("Execute");

VO WHERE Clause at Runtime
ViewObject vo = am.findViewObject("<YourViewObject>");
String whereClause = " Emp_id = 10";

Using Named Bind Variables

ViewObject vo = am.findViewObject("<YourViewObject>");

Add named Bind Variables at Runtime
vo.setWhereClause(" emp_id = :pEmpId");

View Criteria Programmatically
ViewCriteria vc = <yourVO>.createViewCriteria();
ViewCriteriaRow   HeadDeptRow = vc.createViewCriteriaRow();
ViewCriteriaRow   MaintDeptRow = vc.createViewCriteriaRow();





View Object get Executed Query
Inside VORowImpl -- ExecuteQuery

Iterate through VO inside  VOImpl

        RowSetIterator iter = createRowSetIterator(null);
        while (iter.hasNext()) {
        Row r =;
            System.out.println("Ename *** VoImpl " + r.getAttribute("Ename"));
        // Do something with the current row.
        // close secondary row set iterator
        Row row;
        while ((row = != null)
        System.out.println("Ename " + row.getAttribute("Ename"));

What are validation Options in ADF ?
I)Business services:
         Metadata (declarative validation)
         Java (programmatic validation)
b)Database (PL/SQL)
II)User interface

ADF Logging in Deployed Apps

ADF - Passing Parameter Value between Pages

ADF Create with Parameters

ADF Bounded and Unbounded Task Flows

Managed Bean and Backing Bean
Managed Bean can be configured in
b)Task Flow Definition File

Backing Bean on page can be created while
a)Creating new jsf/jspx  or jsfff
b)After creation go to Page Design . Tools --> Design --> Page Properties --> Component Binding
 Click Auto Binding if you want all components on page to be included in Backing bean with acccessors.

Task Flow Refresh

JSF ADF LifeCycle

Custom Phase Listener
for fragments you should extend oracle.adf.model.RegionController

In page add
<f:view beforePhase="#{backingBeanScope.CheckListBackingBean.refreshPageNVC}">

    public void refreshPageNVC(PhaseEvent phaseEvent) {

Diif in af:commandButton,af:commandLink  and  af:goButton,af:goLink
Submit requests and fire action event when activated.
Typically ued for internal validation.
Navigate directly without server side actions.
Do not use control flow rules.
Typically used for external validation.

Implementing Security

Security Basics

Duplicate Anonymous Role Fix

ADF Working with Popups

Oracle Forms to ADF
From Forms to ADF - When, Why, How?
When-Validate-Record  in Forms  -->  Add Entity Level Validation(Business Rules) in ADF.

ADF Multi Choice List

ADF Date Format Conversion

ADF Using doDML
    protected void doDML(int operation, TransactionEvent e) {
        // super.doDML(i, transactionEvent);
        if(operation == DML_INSERT){
            Date vDate = getCurrentDateWithTime();

ADF Skip Validation on Page
Open page definition file and select root tag in the structure window.
Go to Properties window and search for SkipValidation property. Set SkipValidation to true:

Diff in Vo.getFetchedRowCount()  and  Vo.getRowCount()

To String
BigDecimal big = new BigDecimal("987654321");
String str = big.toString();

Export to PDF BI Publisher Integration or  Jasper Reports

some of the links are on that threads.

BI Publisher/PDF Showing ???? for non English FOnts.

Static Class or Static methods can not be instantiated.

System Files Location

Popup Not Closing on clicking any button.
Fix -- af:popup Auto Cancel Enabled

Column value entered in Popup and after Closing popup it removes all previously entered records.
Fix -- Change Auto Submit property to True for previuos fields.

How to import custom classes from model to view controller in adf?

Right click your ViewController project > Project properties > Dependencies > Select Model and click the pencil. Here you select 'Build output' and press OK twice. Rebuild your application and you should be able to access classes from your model in your viewcontroller.

File Download

Display selected table row number and total rows
Row #{(bindings.EmpVO1Iterator.rangeStart < 0 ? 1 : bindings.EmpVO1Iterator.rangeStart+1) + ( bindings.EmpVO1Iterator.currentRowIndexInRange == -1 ? 0 : bindings.EmpVO1Iterator.currentRowIndexInRange)} of #{bindings.EmpVO1Iterator.estimatedRowCount}

Summit Application

ADF Logger

ADF Refresh

Data Dirty

AM Handle from Bean

AM acces from VO

ADF Performance Tuning

ADF Page Variables to Store Data.

1)Create Page Variable in Page Definition    P_INPUT
2)Add Page Variable in Bindings as _var(Just to rename)  P_INPUT_VAR
3)On Input Text put as Value    #{bindings.P_INPUT_VAR.inputValue}
4)From Backing bean access
String vinput = (String)evaluateEL("#{bindings.P_INPUT_VAR.inputValue}");

    public static Object evaluateEL(String el) {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory expressionFactory =
    ValueExpression exp =
    expressionFactory.createValueExpression(elContext, el,
        return exp.getValue(elContext);

ADF InputText Field Suffix
From Navaneetha

<af:panelFormLayout id="pfl1">
<af:panelLabelAndMessage id="plam2"
<af:inputText value="#{bindings.Email.inputValue}"
shortDesc="#{bindings.Email.hints.tooltip}" id="it1"
<f:validator binding="#{bindings.Email.validator}"/>
<f:facet name="end">
<af:outputText value="" id="ot1"/>
1) Ensure that the label for the component is set in the af:panelLabelAndMessage
2) For the inner component, set simple="true" so that there is no label displayed for it.

ADF EL Expression
Calling Method from EL Expression
Calling EL from Bean

ADF Programmatically Select check boxes

ADF Download FIle

ADF Upload Multiple Files

ADF Regular Expression Validation

<af:inputText label="Email Validation" id="it1"
                                <af:validateRegExp pattern="[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"
                                  messageDetailNoMatch="The value {1} is not a valid email address:"/>

try this one...
<af:validateRegExp pattern="^[0]{2}:[0]{2}-[2-3]{2}:[0-9]{2}$" messageDetailNoMatch="Format must be 00:00-23:99"/>

use online regex tester...

Date Validations

<af:validateDateTimeRange minimum="#{DATE1}"
                                                      messageDetailMinimum="Date2 must be greater than Date1"/>
On Date1
<af:validateDateTimeRange messageDetailMaximum="DATE1 must be prior to DATE2"

ADF Contextual Events

Contextual Events

ADF Layouts

Grid Layout using Trinidad

ADF Mobile

ADF Tree Component

ADF Maps

ADF Sending Email

ADF Error

JBO-25014: Another user has changed the row with primary key oracle.jbo.Key

ADF Exception Handling

Task Flow Exception Handler

Error Message Reference

Custom Error Message

ADF Selection Listener

ADF Lov Default

in VoRowImpl
    public BigDecimal getDeptId() {
        return (BigDecimal) getAttributeInternal(DEPTID);
        Row row = (Row)this.getDeptLovVA().first();  // first row from view accessor
        return (BigDecimal)row.getAttribute("DeptId");
        return null;

ADF Internationalization/Localization

ADF Table Custom QueryListener

ADF Search Form

To avoid initial execution of query when page loads one raw method is to add Bind variable with No default value.
eg. STATUS = :p_sts OR NVL(:p_sts,'%') = '%'  
If you want Default value in other parameter try
1)dummy bind variable 1 = :bindDummy
2)In ExecuteWithParams bindings add namedData
NDValue   #{pageFlowScope.dummyVal}
NDName    bindDummy

NDType    java.lang.Integer
3) On Search Button
              <af:setPropertyListener from="1" to="#{pageFlowScope.dummyVal}"


Global Search

AF Query for Search
Multi Select af:Query

ReOrder Columns

Clear Search

Table Pagination
Scroll Policy to Page
Auto Height Roes to Zero
Bindings --> Iterator  Set Range Size for number of rows

Multi Select in Table Filter

select All in Table

ADF Table copy content Functionality

ADF table Column Reposition

Sort Criteria

ADF SelectOneRadio

ADF Javascripts

ADF Sorting Transient VO's
//Populate your transient VO rows.

ADF Iterate Lov View Accessor
        DCBindingContainer bindings = (DCBindingContainer)ADFUtil.evaluateEL("#{bindings}");
        DCIteratorBinding voIterBndg = bindings.findIteratorBinding(pTrIteratorName);
        ViewObject mainVO = voIterBndg.getViewObject();
        Row[] mainVORow = voIterBndg.getAllRowsInRange();
        RowSet attributeVA = (RowSet)mainVORow[0].getAttribute("<YourViewAccessorName>");

ADF Skins

Fusion Dev Guide

Customizing Appearance using Skins

20.2.1 How to Add a Custom Skin to an Application

The directory path to the XML schemas is similar to the following:

Create xml Document from xml Schema

1)Create mySkin.css under skins/mySkin/mySkin.css
2)Create below file under WEB-INF dir
------  trinidad-skins.css

<?xml version="1.0" encoding="UTF-8" ?>
<skins xmlns="">
3)------  trinidad-config.css

<?xml version="1.0" encoding="windows-1252"?>
<trinidad-config xmlns="">

To Refresh skin files
****   If you changed extends in trinidad-skins.css  eg.
<extends>skyros-v1.desktop</extends>   to <extends>fusion.desktop</extends>

To affect changes on actual jspx or jsff
just swap <skin-family>mySkin</skin-family>   to  <skin-family>skyros</skin-family>
and again back to  

Skinning only for One Component

ADF Application Module Nesting

ADF Boolean Custom Converter
Below Blog pulled from

af:selectBooleanCheckbox with [Y, N] values using a custom converter

In ADF, the tag af:selectBooleanCheckbox is a bit special, because the property value is Boolean type and persistent attributes generated in the entities usually are not. There are several implementations that attempt to adapt attributes data types like String or Number, but many do not usually work very well, and may require extra effort to achieve something that any developer would take for granted in a framework as ADF.
The converters are, in my opinion, a powerful tool to solve any of these problems.

A use case could be the VIP_USER table with the following structure:
create table VIP_USER
  vip_user_id NUMBER(6) not null,
  full_name   VARCHAR2(70),
  disabled    VARCHAR2(1) not null -- ['Y', 'N']

DISABLED field is a String in the EO and VO, so we need a converter to "translate" in both directions:
package view.converters;

import java.util.Collection;
import java.util.Collections;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;

import org.apache.myfaces.trinidad.convert.ClientConverter;

public class YNConverter
  implements Converter, ClientConverter
  public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String value)
    return "true".equals(value) ? "Y" : "N";

  public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object value)
    return "Y".equals(value) ? "true" : "false";

  public String getClientLibrarySource(FacesContext facesContext)
    return null;

  public Collection<String> getClientImportNames()
    return Collections.emptySet();

  public String getClientScript(FacesContext facesContext, UIComponent uiComponent)
    return null;

  public String getClientConversion(FacesContext facesContext, UIComponent uiComponent)
    return null;

The converter needs to be declared in faces-config.xml:

The tag af:selectBooleanCheckbox would look like:
<af:selectBooleanCheckbox value="#{row.bindings.Disabled.inputValue}"

Note that the same could be done with Number type attributes [0,1], it would suffice to make a small change in the YNConverter class.

Callable Statement with Table Type

VO Looping
            DCIteratorBinding dcIteratorBdg = bindings.findIteratorBinding"IteratorName");

            ViewObject prgDetVo = dcIteratorBdg.getViewObject();

        RowSetIterator prgDetRsIter = prgDetVo.createRowSetIterator(null);
        while (prgDetRsIter.hasNext()) {
            Row r =;



Positioning Popup at Center

Dynamic UI




ADF Errors

ADF Taskflow From Popup

Reusable ADF Dialog Framework


Javascript to Java call