Skip to main content


Showing posts from May, 2013

Building entity objects connected through association and view objects linked through view links at runtime

In this post I'm sharing yet another sample on building dynamic business components. The sample attached in this post covers APIs for building entity objects connected through associations as well as entity object based  view objects linked through view links.  In fact, the credit for this sample goes to my colleague Sung Im (Architect - ADF BC) who is always helpful for me on all queries or discussions centered around dynamic business components. Many thanks Sung !

This sample will teach you the following:
APIs for building entity objects at run timeAPIs for building association between  entity objects at run timeAPIs for building view objects at run timeAPIs for building view links at run timeDownload 

You can download the sample workspace from here. [Runs with Oracle JDeveloper 11g R2 and Oracle XE].
To know the APIs take a look at The method DynamicBCExample::doProcess(...) builds entity objects for  DEPARTMENTS and EMPLOYEES table, builds as…

Referring ViewAttributeDefImpl properties from the dynamic UI tag

I have blogged on generating dynamic UI some time back. In case you missed them, here are the links
Model driven approach for building Dynamic UI
Enabling LOVs for Dynamic ViewObject attributes
Long living Dynamic Business Components

Here is a tip for you to refer the ViewAttributeDefImpl properties such as label and other custom properties  from the dynamic UI such as dynamic table.
For example if you have set label for an attribute as given below, it can be referred from UI through

Code snippet for setting propertu for attribute definition in a dynamic view object(if you are not following this code snippet read Model driven approach for building Dynamic UI  and come back)

ViewAttributeDefImpl attrdef= getDynamicAttrdef();
attrdef.setProperty("label", getSomeNiceLabel());

UI tag snippet referring the property that we set in the above code.


A new flag for SkipValidation - "validateCurrentRows"

The (also available in ADF release comes with a new flag for  SkipValidation attribute in page definition file - "validateCurrentRows". The setting SkipValidation="validateCurrentRows" will validate only those rows dirtied in the current request (by default run time will validate all dirty rows even if they are validated in previous requests) and also, will skip transaction level validation till you commit transaction. Try it out- its cool and may help you to avoid unwanted validation as well.

Blocking the row navigation in a table, tree and treeTable on error

Problem :  Framework is letting the business user to navigate to different row in a table(tree or treeTable) even when the currently selected row has some validation error. As there are validation error binding layer does not respond to the row selection and the UI appears to be not synchronized with model in such cases.

Solution : The release has introduced a anew flag "blockRowNavigationOnError" for af:table, af:tree anf af:treeTable.
<af:table blockRowNavigationOnError="always".../> 

Copying the description of this flag from the tag documentation.

Property                                                   Valid Values
blockRowNavigationOnError                always, never, auto

Whether we want to block row navigation in case of validation failure.
This is when you select a row and do some editing inside the table or in a related form, and this editing causes some validation failures. At this time, if you click on a different row…

JavaOne India 2013, May 8-9 at Hyderabad International Convention Centre

JavaOne India 2013 is just around the corner( May 8-9, Hyderabad International Convention Centre). This time, we have 4 sessions on ADF and a hands on lab as well.  The fullContent Catalog can be found here. See you there !

CON1178 - Understanding Oracle ADF and Its Role in Oracle Fusion
Learn what Oracle Application Development Framework (Oracle ADF) is all about, what its layers are, and what the development experience looks like. Oracle ADF is the ... View More
Wednesday, May 8, 11:45 AM - 12:45 PM - Hall 2

CON1181 - Developing for Mobile Devices: What You Need to Know Before You Start
With the explosion in the popularity of smart mobile devices, IT shops are scrambling to create applications that meet the requirements of mobile users. This sessions lays ... View More
Wednesday, May 8, 3:15 PM - 4:15 PM - Hall 2

CON1179 - The Future of Oracle Forms: Upgrade, Modernize, or Migrate?
Most Oracle Forms applications contain hundreds of man-years of investment. So what do you do with tha…

Explicitly enabling in-memory sorting for a view object

Sharing a tip that I learned while debugging an issue ;)
When you try to sort a UI component such as af:table bound to a view object, framework by default fire SQL ORDER BY clause if the selected column is not a transient one, otherwise framework will go for an in-memory sort by calling setSortCriteria(...) on the ViewObject.

You can override this default behavior by setting a custom property on the ViewObject. This make sense if your view object is a programmatic  or transient view object or if the view object contains uncommitted rows.To do this, you need to set a property named PROP_ALWAYS_USE_SORT to true (available in release). When PROP_ALWAYS_USE_SORT is 'true', framework will always go for in-memory sorting.

empVO.setProperty(ViewObject.PROP_ALWAYS_USE_SORT, "true");

Warning: Note that when you enable in-memory sorting, framework will fetch all the records from the DB before performing the sort. So it makes sense only if you have limited…