Category Archives: ADF

Unexpected Gift from Oracle Network

Got this gift from Oracle Network as a surprise


Note: I reached Guru status in OTN long back(more than 4 years and receiving reward for it now :))


How to get the selected value for the SelectOneChoice in ValueChangeListener

Here is the snippet to get the selected value for the item selected in a select one choice inside the value change listener

Integer in = (Integer)valueChangeEvent.getNewValue();

JUCtrlListBinding fc = (JUCtrlListBinding)ADFUtil.evaluateEL("#{row.bindings.SelectOneChoiceAttribute}");
String selectedValue = (String)fc.getListIterBinding().getRowAtRangeIndex(in).getAttribute("ListDisplayName");

ADF Mobile Development

I have written a page on ADF mobile here

Tuning for ADF


MaxFetchSize is the maximum number of rows fetched from the database for the current view object. Setting -1 will retrieve unlimited number of rows or the entire rows returned from a query. Setting 0 will cause no query execution and no rows will be returned. Check in the VO for this property.



This is the number of rows that is returned on a single database round trip. This setting will determine how many rows will be returned for a particular view object at run-time on a single query. Set the size In batches of n+1. check in VO, AM instance, table component for this property.



This is the mode that controls how the rows are retrieved in a JDBC resultset. Some of the modes allowed for the FETCH_ALL, FETCH_AS_NEEDED. Number of rows retrieved is based on the RangeSize of the VO.

FETCH_ALL – will fetch all the rows at a time. This causes all rows to be retrieved from a JDBC result set immediately, and then closes the result set.


FETCH_AS_NEEDED – will fetch number of rows defined by the RangeSize first and is again fetched upon request. A fetch mode that causes rows to be retrieved from a JDBC result set as the user navigates through the row set. The result set is closed when the user reaches the end of the row. The executeQuery() will fetch this much only.



Number or rows to be displayed in the Iterator collection. Table rows maps to this. By default is 25. Maps from View Object to the UI Collection. Check in VO, Page definition file for this property.



ListRangeSize is the setting for the List of values that is added to the attribute in the View object which will be set to less value to reduce large number of rows getting returned unnecessarily. Setting -1 will retrieve all the rows. Check in the VO for this property.


Specify a value to determine if a result set returns the number of rows you specify as a value. If you set RowCountThreshold to 0, the Iterator returns the estimated row count in the result set by executing the count query. If you set RowCountThreshold to less than 0, the Iterator does not execute the count query. If RowCountThreshold is set to -1 then it will load the table faster and will not execute the SELECT COUNT query for the number of data retrieved. Check in page definition file.



This defines how the row is accessed in a view object. The modes are

SCROLLABLE – Rows are cached in a collection. This is the most flexible mode for accessing rows and working with a RowSet. Ideal for less number of rows. For large numbers use RANGE_PAGING or RANGE_PAGING_INCREMENTAL.

FORWARD_ONLY– Sequential Access to rows in a collection. The Iterator on this RowSet will not allow scrolling back


RANGE_PAGING – The paging is done based on the RangeSize defined. If the rows which are requested are not in the range then the rows are fetched from the database using the ROWNUM query. it only keeps the current range (or “page”) of rows in memory in the view row cache at a time

RANGE_PAGING_AUTO_POST – The rowset will post any changes in the transaction for rows out of the current range.


RANGE_PAGING_INCR – the UI incrementally displays the result set from the memory cache and thus supports scrolling within a single database query. the UI incrementally displays the result set from the memory cache and thus supports scrolling within a single database query. The number of rows that the end user can scroll though in a single query is determined by the range size and a range paging cache factor that you set. For example, suppose that you set the range size to 4 and the cache factor to 5. Then, the maximum number of rows to cache in memory will be 4*5 = 20


Query Optimizer

These are hints added to the query to help retrieve the record efficiently. This will influence the execution plan of the query.  Check in the VO.

ALL_ROWS – Fetch all the rows as soon as possible.

FIRST_ROWS – fetch the first rows as quickly as possible

Row Limit

This is updated in the adf-config.xml file. The value of -1 will fetch all the rows for the VO in the application. You can limit the row limit fetched by the VO in an application using this option.



The number of rows used to size the component height. The default value is -1 (no auto-sizing for any number of rows). The height of the component can grow to a maximum of autoHeightRows after which a scrollbar is displayed. A value of 0 can be used to default the autoHeightRows to the current fetchSize. autoHeightRows value cannot be larger than fetchSize attribute. Check in the table component.


Configurations in the web.xml file to maximize ADF Application Performance

Disable Automation


Disable Assertion


Disable Javascript Profiler


Disable Debug Mode


Disable Javascript Debugging


Disable File Modification


Enable partitioning


Enable compression


All are explained in the documentation.
Only web.xml related parameters are added here

How to in Jdeveloper ADF – increase the inputcomboboxlistofvalues dialog width


To increase the width of the af:inputcomboboxlistofvalues dialog box.


Recently I have been challenged to increase the width of the af:inputcomboboxlistofvalues dialog box. using contentStyle or inlinestyle will increase the width of the component and the dialog box will remain the same. So i thought of playing with the CSS file and could possibly achieve the width with the following hack.

<af:resource type=”css”>
   min-width: 500px;

How To in Jdeveloper ADF – To call a VO from another VO or from AM method

How to set an Attribute value from one VO into another VO?


//in you Application module Impl file have the follwing code written inside the method which will set the value for another vo
//lets say UploadView is the View object that you would want to set the value
ViewObject vo = findViewObject("tUploadView");
//if its not in Application Module, you will have to get the VO instance either from iterator if you are using this code in the bean
//get the rowset of UploadView
RowSet rs = vo.getRowSet();
//iterate through
//get the row
Row r =;
//set the value
r.setAttribute("ValueItem", value); //ValueItem is the Attribute that you want to set