Please disable your adblock and script blockers to view this page

Search this blog

Showing posts with label ADF Basics. Show all posts
Showing posts with label ADF Basics. Show all posts

Monday 13 November 2017

ADF Basics: Add the row at the end of ViewObject's current RowSet in ADF


This post is about adding a row at the end of current rowset of viewObject without using table or any other UI components binding


Here I have a Department ViewObject (HR Schema), dropped as a table on page and a button to add new row, this button calls a method from model using binding layer 

Wednesday 13 September 2017

ADF Basics: Filter ViewObject data using getFilteredRows and RowQualifier


Sometimes we need to get filtered data from ViewObject using one or multiple conditions,
Though this is the very basic of framework yet new developers find it confusing.

There are two ways of filtering ViewObject

 1. In this we apply WHERE clause on ViewObject and it affects resultSet data, Suppose we have Department ViewObject and we want to see data of DepartmentId 4 on page after filtering, for this viewCritera, bind variables comes in action
ADF Basics: Apply and Change WHERE Clause of ViewObject at runtime programmatically

2. In this user want to get filtered data (Rows) in code only without any effect on ViewObject resultSet (page data), Here I am discussing this point

We can get filtered data from view object using two methods-

Tuesday 11 April 2017

Oracle ADF Best Practices, Mistakes and Worst Practices


In this post I am putting some practices and that we should follow while using Oracle Application Development Framework for development


Monday 10 April 2017

ADF Basics| Tip to Hide af:inputListOfValues search popup at runtime

Hello All

Previously I have posted about a requiremnt of  hiding af:inputListOfValues search icon using CSS
ADF Skinning | Hiding search icon of af:inputListOfValues using CSS & StyleClass

In that solution search icon doesn't appear on page but it is a part of JSF component tree so when user press TAB+SPACE after entering a value in lov component then search popup appears on screen as this action invokes search icon click event

Recently a Friend of mine came across another requirement that was not showing lov popup at all as only autoSuggest behavior was required , so for this first way is to use autoSuggest behavior in an af:inputText compoent using Lov bindings and second way is to short circuit component life cycle

Monday 20 March 2017

ADF Basics: Tip for not showing record in dependent lov


Hello All

Recently I have seen a question on OTN forum - Question on cascading LOV

It was about cascading lovs in ADF
Suppose we have 2 dependent LOVs and requirement is that 2nd lov should not show any data until first one is selected , this is very simple and common use case but for beginners it's a tedious task

So I thought to write it here to help others

Thursday 12 January 2017

ADF Basics: Duplicate Record Validation Using Model Level Business Rules


Hello All

Hope you all are doing well :)

When we are creating any data entry form , at that time preventing duplicate entries for some of attributes is very basic validation requirement .

Suppose We are creating a form to make new Departments entry and  there should not be two departments with same name so for this type of validation we need not to write single line of code in Oracle ADF as there are predefined business rules for basic validation

Tuesday 11 October 2016

OTN Appreciation Day: Oracle ADF Bindings #ThanksOTN

Hello Everyone

I am late still I thought to write about Oracle ADF Bindings for OTN Appreciation Day

ADF binding layer works as glue between Model and View layer, Values from model propagates to page through Binding layer

UI Components are associated with business logic through this layer , this reduce lots of developer effort , it maintains row state , fetching mechanism etc.
Binding definition of components are defined in a XML file called page definition, Model layer uses this file to instantiate the page's bindings

Wednesday 3 August 2016

ADF Basics: Iterate over master detail viewObject using view link accessor


Hello All

This post is about iterating over master and it's child view object using view link accessor, this is very basic thing of framework still some find (those who are starting with ADF) it difficult so I thought to write it here

Here I am using Departments and Employees table of HR Schema to create Master-Detail relation and due to view link relation, Department viewObject has view link accessor of Employees viewObject

Saturday 30 July 2016

ADF Basics: Populate simple programmatic View Object using POJO


Hello All

I hope you all know that we have 4 type of viewObjects in ADF, Here we'll discuss about a simple programmatic viewObject
  • Entity Object Based
  • SQL Query Based
  • Static List Based
  • Programmatic ViewObject
Programmatic ViewObject can be created by overriding appropriate methods in ViewObject's Impl class to retireve data from REF CURSOR, Array or any Java file
Here in this post I am using an ArrayList (POJO based) to populate viewObject records so for that I'll override some methods of ViewObject Impl class

Saturday 11 June 2016

ADF Basics: Use transient attribute to show description of selected value in case of input and combo Lov


In ADF often We apply LOV on a ID attribute to show it's Description to user, This works good in case of choice list (selectOneChoice) but if we use Input Text with List of Values (<af:inputListOfValues>) or Combo Box with List of Values (<af:inputComboboxListOfValues>) then after selection ID appears on page instead of  Description like this


So to avoid this we apply LOV on a transient attribute that shows Description and sets ID value DB attribute, See how to implement this

Saturday 4 June 2016

ADF Basics: Count number of records in LOV using LOV Accessor

Hello All

This post is about a simple requirement - How to count number of records in a LOV ?
I have seen this type of threads on OTN forum so here I am writing about it

We can make use of LOV Accessor to  count number of records in LOV as per selected source viewObject record, Here I am using Departments and Employees table of Oracle HR Schema

Thursday 21 April 2016

ADF Basics: Get display and base value of POJO based SelectOneChoice


Previously I have posted about populating selectOneChoice programmatically using POJO

and this post is about getting selected value of POJO base selectOneChoice (both display value and base value)

Sunday 6 March 2016

ADF Basics: Call PL/SQL Function with OUT parameter in ADF Application

Previous post was about calling PL/SQL Procedure with OUT parameters in ADF Application
ADF Basics: Call PL/SQL Procedure with OUT parameter in ADF Application

And this post is about calling PL/SQL Function with OUT parameters. Basic difference between a Function and Procedure is that Function must return a value but procedure may or may not return a value
So there is always one OUT parameter in PL/SQL Function

Thursday 3 March 2016

ADF Basics: Call PL/SQL Procedure with OUT parameter in ADF Application

Previously i have posted about calling pl/sql function in ADF Application

This post is about calling stored procedure in ADF Application , a very basic requirement.
Sometimes we need to call a procedure that has OUT parameters , these parameters are used to return value from procedure. There may be n- numbers of OUT parameters in a procedure 

Wednesday 10 February 2016

ADF Basics: Creating Bounded Task Flow Train using af:train component

This post is about using bounded task flow as train
A train presents a whole cycle and it's every stop presents a particular step of cycle
From the docs -

The train component presents a user with a series of stops, each stop representing a step in a multi-step process. The train walks the user through these steps, in a suggested order (the order being dictated by the underlying model). Each step is rendered as a train stop consisting of an image and a textual link indicating if they are in visited, current, unvisited and disabled states. Train can also be rendered in a vertical layout - the default being a horizontal layout. Trains are not rendered on printable pages. 

Monday 1 February 2016

ADF Basics: Using setActionListener in ADF, Set pageFlowScope parameter without writing code

This post is about using setActionListener tag in ADF, this tag provides a simpler way to set values of other objects and makes use of EL
See What docs says-

The setActionListener tag is a declarative way to allow an action source (<commandButton>, <commandLink>, etc.) to set a value before navigation. It is perhaps most useful in conjunction with the "pageFlowScope" EL scope provided by ADF Faces, as it makes it possible to pass details from one page to another without writing any Java code. This tag can be used both with ADF Faces commands and JSF standard tags. More generally, it can be used with any component at all that implements the standard ActionSource interface.

Tuesday 3 November 2015

ADF Basics: Using f:attribute to pass parameter in ActionEvent

f:attribute tag (JSF Tag supported in ADF Faces) is used to pass some additional attribute value to associated component
Sometimes using f:attribute simplify a complex piece of code, this tag has very simple structure. It has two properties

name- Name of tag attribute
value- Value or an EL reference of value

Here in this post we will see how to use this tag with ADF Faces, I am using Departments table of HR Schema and requirement is to delete departments with attribute DepartmentId  greater than 100

Wednesday 7 October 2015

ADF Basics: Reorder ADF table column using DisplayIndex property

This post is about a very simple use case that is reordering of af:table column at run time. 
Ordering of columns in af:table is controlled by DisplayIndex property of af:column
Check what docs says-

Default Value: -1

The display order index of the column. Columns can be re-arranged and they are displayed in the table based on the displayIndex. Columns are sorted based on the displayIndex property, columns without displayIndex are displayed at the end, in the order in which they appear. The displayIndex attribute is honored only for top level columns, since it is not possible to rearrange a child column outside of the parent column.
Not supported on the following renderkits: org.apache.myfaces.trinidad.core

We can set DisplayIndex property for all columns in a sequence (1,2,3 etc) that we want to see on page

Monday 14 September 2015

ADF Basics: Call PL/SQL Stored function in ADF Application


This post is about calling stored function in ADF Application , a very basic requirement. Many times we need to call a PL/SQL function in ADF app for any specific requirement.
In this post i am discussing same so for that i have created a PL/SQL function that takes EmployeeId as input parameter and return it's Employees Name (Using Oracle HR Schema)


CREATE OR REPLACE FUNCTION FN_GET_EMPNAME(EMP_NO NUMBER)
RETURN VARCHAR2 IS
   EMP_NAME VARCHAR2(50) := 'N';
BEGIN
   SELECT FIRST_NAME||' '||LAST_NAME into EMP_NAME
   FROM EMPLOYEES WHERE EMPLOYEE_ID=EMP_NO;
   
   RETURN EMP_NAME;
END;

Friday 28 August 2015

ADF Basics: Using setPropertyListener to set value in memory scope variables

Soemtimes we need to set a value in memory scope variable on some event
In ADF af:setPropertyListener does this for you declaratively

The setPropertyListener tag provides a declarative syntax for assigning values when an event fires. The setPropertyListener implements the listener interface for a variety of events, to indicate which event type it should listen for set the 'type' attribute.

Read more about <af:setPropertyListener>