Sunday, December 6, 2009

Dynamic Region UIShell

I had created a Dynamic Region Template before the release of new jdeveloper patch.
Since there is a lot of discussion about the new Oracle UI Shell I decided to share it as I feel it is:
  • Simpler
  • Easier to use
  • Uses Dynamic Regions to navigate to different task flows
  • Provides customized functionality about navigating while having pending changes
  • Supports security permission check for navigating between task flows
The source code of the DynamicUIShell is here.


I also created a demo application based on HR schema, that uses this template to show the functionality. http://adfbugs.googlecode.com/files/TestDynamicUIShell.zip

In this demo you can run test page and see the functionality.
You can navigate between Home, employees and departments task flows.


If you make a change and try to navigate to an other task flow a popup raises and rollback if you chose continue.


If you try to navigate to Secured task flow a popup inform you that you don't have permission.


How to use Dynamic Region UIShell

Just import the jar file in your view controller project.



Then when you create a new JSF page you can select the template 'DynamicUIShell'.




Now you have the page based on the template.




First thing needed is to define the DefaultRegion , the task flow to be rendered in main area when the page is loaded.



i.e. f:attribute name="DefaultRegion" value="HomeTaskFlow"
Now the page should be functional and display the DefaultRegion task Flow.

Adding navigation components.

You can add now navigation components in facets like Global, TopMenubar, LeftToolBar.
Navigation components can navigate to other pages or display a different Task Flow in the main area.
In order for navigation components to be functional 2 properties are needed:
ActionListener should call navigate method of dynamicRegion managed bean (that exist in library).
Id of the component must be the path and name of task flow inside WEB-INF (with / character replaced with _):


Adding pending changes popup.

In order for pending changes to be checked a popup is needed to be added to your page, with your custom message and a Continue button.
The popup must be binded to dynamicRegion managed bean changesExist popup
The Continue button must have actionListener to dynamicRegion managed bean method continueNavigation method.
If you want to Rollback before navigation the Rollback action must exist in page definition.


Adding no permission popup

In order to check permission (taskFlowViewable) you need to add a popup on your page binded to noPermissionPopup of dynamicRegion managed bean.


Also when security is enabled in your application don't forget to allow access also to the template. To see the template in your jazn-data you need to select 'Show web pages imported from ADF libraries' check box.



Any feedback is usefull.

2 comments:

  1. How about uploading this as a project or a sample to http://www.samplecode.oracle.com

    ReplyDelete
  2. Hi Michael

    Is it possible to use dynamic regions in this way over split applications? I.e.: if you page with the region is calling a .jsff page fragment which is in another project accessible through an adfLib? I'm struggling to do it this way and heard that it might not be possible, so I just want to get more clarity / detail on why not and what are the issues around this.

    Regards,
    Mario

    ReplyDelete