Please disable your adblock and script blockers to view this page

Search this blog

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

Tuesday 7 June 2016

Open af:inputListOfValues popup by calling JavaScript programmatically


af:inputListOfValues provides option to open Lov values in a popup and allow user to search, We can open this popup by clicking on magnifying glass icon


Recently I have seen a thread on OTN forum where user wants to open lov popup on a button click after checking some conditions and also found a post by Frank Nimphius Where he used javascript to open Lov popup on double click of mouse.
So guess what I have done ? ;)
Just called that javascript fucntion programmatically on button click

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

Monday 23 May 2016

Execute batch file from Java Code using Runtime class

We can call any exe file from Java code using Runtime class, Runtime class extends Object class and introduced in JDK1.0

What docs says-

Every Java application has a single instance of class Runtime that allows the application to interface with the environment in which the application is running. The current runtime can be obtained from the getRuntime method.
An application cannot create its own instance of this class.

Here we will see how to execute .exe and .bat file from javacode, for executable files we just pass file path and Runtime class will invoke it. But for batch file we have to first open supporting application i;e Command Promt and then provide path for batch file

See Java Programs for both case:

Friday 20 May 2016

Navigate to another page on value change event of ADF input component

Recently I have seen a thread on OTN forum in that user want to navigate from one page to another on valueChangeListener of input component.

First Method-
This is a simple piece of code to perform navigation to specific page , Use it in ValueChangeListener directly

 FacesContext facesContext = FacesContext.getCurrentInstance();
 facesContext.getApplication().getNavigationHandler().handleNavigation(facesContext, null, "controlFlowName");

Second Method-
ValueChangeListener fires when value of input component changes but it is not meant for navigation, For navigation we use buttons and links with Action property
But for this requirement we have to be a bit tricky, We can queue button Action on value change listener of inputText to navigate to another page
Now first value change listener will be executed and then it'll queue button action to execute and as final outcome user will be able to navigate

Thursday 19 May 2016

Traverse POJO based ADF treeTable, Get Child nodes of selected parent


Previosuly I have posted about populating af:treeTable programmatically and getting selected records from POJO based treeTable

This post is next in that series and here I am extending same sample application that show a tree of Seasons and it's characters
First we will see How to traverse a POJO based treeTable (Iterate through all nodes of treeTable)

Basic idea is to get treeTable Collection Model and iterate over it to get all nodes value, To get CollectionModel created treeTable component binding in managed bean

Monday 16 May 2016

How to queue SelectionEvent programmatically, Call af:table Selection Listener programmatically

Hello All
Hope you all are doing good :) 
Previously I have posted about defining custom selection listener for af:table and perform desired operation on selection event of table row

Selection Listener is fired when server receives a selection event from client means whenever user selects a row in table (Selection Event) then server process that event and execute selection listener defined in managed bean

And this post is about creating selection event programmatically without user interaction with table.
In ADF we can queue ActionEvent , ValueChangeEvent and in same manner we can create and queue SelectionEvent programmatically

Friday 13 May 2016

Get Selected records (Child/Parent) from POJO based ADF treeTable

Hello All
Previously I have posted about creating af:treeTable programmatically using POJO and this the next post in series

In this post I am talking about a very common requirement while using POJO based treeTable
How can we get selected records (child/parent) from POJO based treeTable ?

For this post I am extending same sample application, Till now we have seen that how can we create POJO based treeTable
Now we'll see that how to get it's selected records


Saturday 30 April 2016

Create ADF Choice List and apply selectItems to it programmatically

I hope we all know how to create selectOneChoice using Model layer and previously I have posted about populating selectOneChoice programmatically from bean using ArrayList

Programmatically populate values in a af:selectOneChoice component in ADF

But this post is slight different - It is about creating selectOneChoice component and applying selectItems to it programmatically
There is nothing complicated in this , Just a piece of code is required
Here I have used an ArrayList to set SelectItems and created component binding for af:form to add selectOneChoice as it's child 

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)

Tuesday 19 April 2016

Define WHERE Clause on dynamic ViewObject created on the fly

Thursday 14 April 2016

ADF Skinning: Change Style of ADF Table, Column, Header, Data Cell and pagination bar


After a long vacation I'm back to work :)
This post is about changing look n feel of ADF Faces af:table component

I have seen many questions related to changing table column header style , selected row style, changing row banding styles etc

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 2 March 2016

Configure ADF Skin in Jdeveloper 11.1.1.7


In Jdeveloper 11.1.1.7 there is no option to create ADF Skin declaratively
In order to apply skin we have to create a simple CSS file and then configure application to use this CSS file as skin. Jdeveloper doesn't do this for us :( we have to do it manually

So first step is to enable Skin Selectors for ADF Faces, Without enabling this CSS editor doesn't show ADF Faces component tags
CSS files by default supports HTML tags  only

Go to Tools > Preferences > CSS Editor and set CSS level to level 3 and check the box to support ADF Faces Components

Saturday 27 February 2016

ADF Skinning: Increase width, Change color of a tab in af:panelTabbed

We can change appearance of ADF Application by applying CSS and changing style properties of ADF Faces Component
Here i am writing a simple CSS to increase tab width of af:panelTabbed component

I hope you all know how to create a skin for ADF Application , If don't know then look at this post
ADF Basics: Using CSS to change appearance of application (Skins and Styles in ADF Faces)