Friday, January 23, 2015

Custom Selection Listener for ADF Table

In this post I will be describing how we can  have a custom selection listener for ADF Table. By default when we drag and drop a ADF Table Component, it gives us the option to select a row. If that option is selected, it creates a default selectionListener for the table component that is
#{bindings.VO.currentModel.makeCurrent"} where Iterator is VO iterator. This operation synchronizes the current selected row with the Iterator to which this Tree Binding is pointing to.

In Addition to this it also adds a attribute selectedRowKeys which has a value
#{bindings.VO.collectionModel.selectedRow}. This makes the selected row from the collection.

But when you change this to your custom selection handler of your managed bean, then the operation which are performed by {bindings.Iterator.currentModel.makeCurrent"} and selectedRowKeys needs to be done programmatically.

One way is to invoke #{bindings.VO.currentModel.makeCurrent"} programmatically in the selectionListener of the managed bean. This has been explained very clearly by my friend Ashish Awasthi :- Custom Selection Listener

Monday, January 19, 2015

Get SelectOneChoice Code/Values in Managed Bean - ADF

The repeated question on OTN is how to get the code or value  of the selected item from SelectOneChoice. One of my post explains how we can achieve this using variable iterators in page definition. Here is the link for the post : http://rohanwalia.blogspot.sg/2013/09/retrieve-selected-value-from.html

Using the technique described in the above mentioned approach, we get hold of the id or value when we select the item from select one choice and we can use it on the page.

But the problem comes when this value is needed in a method of managed bean using ValueChange Listener . One scenario for this is that the code of selected item is required as an input to call a method exposed by ApplicationModule.

So our use case will be to get EmployeeId of selected Employee from LOV into valueChangeListener.

To start with lets quickly create a sample application. Used HR schema and created one jspx page selectOneChoice.jspx .

Go to the binding and create a new variable inside variable iterator.

Tuesday, December 30, 2014

Data Presenter article in Top 10 OTN WebCenter Articles for 2014

Happy to know that my article about Data Presenter on OTN is in top 10 Webcenter articles on OTN. Below is the link for the listing of top 10 webcenter articles on OTN.

https://blogs.oracle.com/archbeat/entry/top_10_otn_webcenter_articles

Congrats to all the persons whose article is there on the list.

Its Good to close 2014 on a Happy Note :)

Have loads of fun on New Year Eve and may you have an awesome 2015.

See you guys in 2015 with next post.

Thanks

Monday, December 22, 2014

Custom Exception Handling in ADF - Model Layer Generic Framework Design

I have observed that there are lot of users who asks questions on OTN and have problem in designing the custom generic exception handling framework. So in this and next some of the posts I will be describing how we can lay down a generic way to report custom exceptions to the page. These custom exceptions may be mostly for Business Specific errors for which we need to display a custom user friendly message on the page to the user.

In this post we will be seeing how we can customize the error on Model layer and take error messages from a resource bundle defined in the application.

Lets get started. We will first create a generic framework project where we will add exception handling related classes. We give it a name as FrameworkUtil. Framework util project will be dependent on model project from where custom Exceptions will be thrown in the enterprise applications.

First lets set up FrameworkUtil project - ADF Model Project 

Friday, November 28, 2014

NIAIOUG - 9th Tech Meet at Jaipur India

I will be a part of 9th NIAIOUG Tech meet at Jaipur Rajasthan India. This is for the first time NIAIOUG is organizing Oracle User Group Tech Meet in Rajasthan. I am very please to be part of this meet and look forward to a great audience at JECRC University Jaipur. Hope to see some awesome IT Professionals and Students in my session.

Aman, Nikhil and Navneet will be speaking on Database topics. This all will be very useful for DBA's as well as aspiring DBA's.

I will be speaking on ADF and Jdeveloper 12c. There will be a small demo at the end and then there will be open question answers session where anyone can ask questions as how to learn , move into Oracle ADF.

Hope to have a good time @ JECRC Jaipur.




Thanks !!

Tuesday, November 25, 2014

Data Presenter Framework - Webcenter Portal PS7

Data Presenter

One of the most useful features of Webcenter Portal is Data Presenter. Data Presenter allows developers/administrators to create data controls at runtime, and they are readily and immediately available for application usage, without any restart of servers. One more advantage of Data Presenter is ability to create task flows at runtime. Both data controls and task flows can be created at runtime in the Webcenter Portal PS7, with no coding needed in JDeveloper. These newly created data controls can be used in the task flows to create UI and these task flows can be reused wherever needed across the application.

This is useful for Developers, Technical Leads and Technical Architects as earlier, they need to take a decision to create custom task flows separately in JDeveloper and deploy them on Weblogic and use them inside the Webcenter Portal. This is highly useful for developers and Webcenter administrators due to easy learning, and saves significant effort. All this requires quite an effort and is little cumbersome to set it up at the beginning. Data Presenter marks this problem and provides solution to this in quite good way.This article provides an overview of WebCenter Data Presenter and hands-on instructions, steps to implement above functionality.

Monday, November 24, 2014

Persisting to MDS Store using Programmatic API's in ADF

In last some of the posts regarding MDS, we saw how to achieve Personalizations and Seeded Customizations in Enterprise applications using Oracle ADF. There was explanation how to leverage Oracle ADF MDS framework for this purpose. Most of the personalization and customization is provided OOTB by the framework and just requires correct configurations and steps to achieve. These are declarative user customizations which allow to implicit save component changes done by the user.

But there are scenarios where some custom persistence is required to be saved to MDS Store. This means, that state of the components needs to be changes based on certain conditions. This explicit saving of state of components can be done using Java API provided by the framework.

Lets take an example for this post:
This example uses a ShowDetailFrame which is webcenter component. There is a button show/hide SDF which hides and shows the below SDF. Now this hide and show of SDF is being persisted in MDS Store. For now we will take File system based MDS Store. So for a particular user, when user performs show or hide of SDF, its state is stored in MDS and is presented to the user when it Logins next time into the application.