Please disable your adblock and script blockers to view this page

Search this blog

Wednesday 13 December 2017

Use ViewObject Query Mode for In-Memory Sorting of data in Oracle ADF


Hello All

Previously I have posted about In-Memory filtering of ViewObject by changing ViewCriteria's query execution mode, Now this post is about In-Memory sorting of records in viewObject. By default sorting and filtering in viewObject works on the rows retrieved from DB

We can change ViewObject Query mode as per our requirement, There are 3 different SQL query mode


Wednesday 29 November 2017

Export ViewObject data to Excel File Using Apache POI in Oracle ADF


Hello All

Previously I have posted about importing data in ADF Table from Excel file

This post is about exporting viewObject data in Excel file using Apache POI API, Apache POI provides HSFF and XSFF to read , create and modify spreadsheets.
You can download POI jars from The APACHE Software Foundation or from here
Other than this you need to use xmlbeans and common-collections Jar

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-

Wednesday 23 August 2017

Add new row and copy existing row to HTML table using JavaScript


Hello All

This post is about adding new row in HTML table using form entry or copy existing row to table using javascript

So here I have created a HTML page, added a form, two buttons, and a table on page and it looks like this


Sunday 23 July 2017

R Data Types - Vectors, Matrices, Lists, Factors, Data Frames

Like other programming languages, R supports many different data types. You must have seen that variables are used to store data in a program and a data type is assigned to a variable and that variable can hold only that type of data. In this post, we'll learn about R data types and R objects. Basic data types in R programming are Numeric, Integer, Character, Logical and Complex and other than this R has some unique data types that are called R Objects.

Vectors in R

A Vector is basically a set of values of the same basic data type like numeric character etc. A vector in R is created using the c() function that represents a combination of elements. See this example
# A Numeric Vector
numeric_vector <- c(10, 20, 30)

# A Character Vector
character_vector <- c("a", "b", "c")

# A Boolean Vector
boolean_vector <-c(TRUE,FALSE,TRUE)
The output on R Console is 


Matrices in R

R supports Matrices and a Matrix is a collection of data values in 2 dimensions of the same basic data type, R creates a matrix of values using a matrix() function. See this example Here c(1,2,3,4,5,6,7,8,9) is a numeric vector nrow is the number of rows in the matrix ncol is the number of columns in the matrix
#Create a matrix using Vector
test_matrix<-matrix(c(1,2,3,4,5,6,7,8,9), nrow=3, ncol=3)
#Print matrix on console
print(test_matrix)
The output on R Console is 



Arrays in R

Arrays are the same as any other programming language and in R array is same as a matrix but it can have more than two dimensions. Array in R is created using array() function and uses a vector as input and dim value to create arrays. Here dim =c(2,2,4) means that 4 arrays will be created of 2x2.
#We have two vectors here
v1 <- c(1,2,3,7,8,9)
v2 <- c(4,5,6,10,11,12,13,14,15,16)

#Create array using vectors
test_array <- array(c(v1,v2),dim = c(2,2,4))

#print the array on the console
print(test_array)
The output on R Console is

  

Lists in R

A List is a set of values that can have the different basic data type, In R List is created using list() function.
#A list with different data types
#Declare a numeric vector
numeric_vector<-c(1,2,3)

#Create list 
test_list<- list("Ashish Awasthi", numeric_vector, 5.3)

#Print list
print(test_list)
The output on R Console

  

Factors in R

Factors are created using vectors as base and stores unique values as levels, In R Factor object is created using factor() function.
# Create a vector with duplicate values
emp_names <- c('James','Ram','James','Ashish','Ram','Ashish','James','Ram')

# Create a factor object using vector
factor_emp <- factor(emp_names)

# Print the factor object
print(factor_emp)
The output on R Console is 



Data Frames in R

Data Frame is used for storing data in tables, and this tabular data can have multiple types of vectors like numeric, characters etc. Data Frame can be created using data.frame() function.
#A Character Vector
string_vector <-c("Ashish", "Awasthi","R")

#A Numeric Vector
numeric_vector <- c(10, 20, 30.5)

#A Boolean Vector
boolean_vector<- c(TRUE, FALSE, TRUE)

# Create the data frame using all 3 vectors
test_df <- 	data.frame(string_vector,numeric_vector,boolean_vector)

#Print result
print(test_df)
The output on R Console 




Though this post gives an idea of using variables, In the next post, we'll learn more about using variables in R programming. 

  Cheers :) Happy Learning

Monday 17 July 2017

Reinitialise taskFlow in dynamic region and set focus to default activity


Hello All

We all use bounded task flows in ADF application development and to switch between multiple task flows we use concept of dynamic region

Recently I came across a problem about dynamic region and bounded task flows, Scenario is like this

I have dropped a BTF in dynamic region and there is a link on page to open that task flow and those who have used dynamic region would be familiar with this piece of code


Wednesday 28 June 2017

Hide values from ADF SelectOneChoice using EL expression on UI


This post is about a specific requirement that is to hide some values from adf based select one choice from UI
Previously I have posted about disabling some items from select one choice and this post uses same steps to hide values from lov

Saturday 3 June 2017

oracle.jbo.domain.DataCreationException: JBO-25009 while using multiple selection component in ADF Faces


Previously I have posted about using multi-selection components (af:selectManyCheckbox, af:selectManyChoice, af:selectManyListbox, af:selectManyShuttle) of ADF Faces. These components make use of list binding and work on base attribute and display attribute concept

Access JAX-WS WebService from Java Class using Web Service Proxy in Jdeveloper


Web Service proxy class is a way to communicate with XML-based WebService using SOAP format,
In short, we can use service proxy class at client to access WebService

In JDeveloper IDE we can easily create client proxy class for WebService, Here in this post I am creating client proxy class to access a JAX-WS web service that I have created in previous blog post

Create POJO based JAX-WS WebService easily with Jdeveloper 12.1.3

Let's see how to implement this


Monday 22 May 2017

Populate select one choice using Web Service Data Control in ADF Application


My previous post was about creating a JAX-WS Web Service from Java Bean and consuming web service and showing data in ADF table. Now In this post, I am going to elaborate about consuming that Web Service in ADF Application and show Employees data in selectOneChoice component


So for this requirement, We need to use Web Service Data Control and from that WSDL we can create ADF Faces components

Let's see how to implement this

Thursday 18 May 2017

Populate data in ADF Table using Web Service Data Control


My previous post was about creating a JAX-WS Web Service from Java Bean. Now In this post, I am going to elaborate about consuming that Web Service in ADF Application and show Employees data in ADF Table

So for this requirement, We need to use Web Service Data Control and from that WSDL we can create ADF Faces components

Let's see how to implement this

Monday 15 May 2017

Create POJO based JAX-WS WebService easily with Jdeveloper 12.1.3


Hello All

In this post, I am talking about creating a simple JAX-WS web service using Jdeveloper 12.1.3 .
JAX-WS is a Java API for XML Web Services and we can create a JAX-WS easily with Jdeveloper IDE
Idea is to create a web service that shows Employees list with their name, designation, salary and department name so for this, I am going to use POJO Java Class

Let's implement it

Friday 12 May 2017

Understanding Nested Application Modules in Oracle ADF


Application Module acts as a container for view Object and view Link business components that are used in a specific task. It provides data model and data control to show required information and perform action for the client
An application module represents a single transaction and owns one database connection that's why commit and rollback works for all view Objects inside an application module

Tuesday 9 May 2017

Check for dirty (Uncommitted) data of current view port (page) on a button click or any event in ADF


Sometimes we need to check for uncommitted data on page and perform actions according to that, Suppose there is a button to navigate to another page but only if there is no uncommitted data in current page
We can use uncommitted data warning property of af:document to show an alert dialog but in that way, we can't execute our custom logic

Previously I have posted about checking dirty data of a transactional data control but in that, we need to check that for each data control separately that is rendering on page

Thursday 4 May 2017

Implement contains/endswith behavior in model based autoSuggest Lov (Input list and combo box)


Hello All

Hope Everyone knows about list of values and autoSuggest beahvior of ADF Framework,
For those who are new to framework can look at this post
ADF Basics : Implementing auto suggest behavior in ADF Faces lov (list of values)

Monday 1 May 2017

Undo row selection of af:table in selection listener method conditionally


Recently I have seen a question on OTN Jdeveloper forum and It was about table selection listener
Requirement is like this suppose user has to check a condition after selecting a row and if that condition is true only then new row will be selected else selected row should be previous one

It means undo row selection on validation(condition) failure
So In this post I am implementing same scenario and here I am using Departments table of HR Schema to prepare model and condition is that user should be able to select new row only if ManagerId is not null

Wednesday 26 April 2017

Resize FacesMessage, Change look n feel of Message Box using ADF Skin


We all must have used FacesMessage somewhere in ADF application, FacesMessage is used to show any notification like error, warning or confirmation
Here you can read more about FacesMessage

Previously I have posted about changing default icon of FacesMessage using ADF Skin now this post is about resizing FacesMessage dialog and changing it's look and feel