ADF 11gR2 has some very nice UI Hints features. Some were already available in previous releases. In this post I will describe the effect of the UI Categories. On the go, I will also point out some other new features. To see how this works, I created simple ADF Business Components from tables (That is, only the employees table from the HR schema). When you open the ViewObject editor, and go to the attributes tab, you will immediately notice (new feature) that all properties for the attributes are available in this tab, so no longer need to open the editor per attribute.
Lets look at the UI Categories. When selecting the tab “UI Categories” you will see the default grouping of the attributes for the view object.
Now create a new category called “Name” to put the attributes related to the name of the employee.
The attributes can be dragged to the new category (too bad its one by one and not multi-select, I need ot have something to complain !). Per attribute you can define extra UI Hints. Also the category will have its own hints. You should also be able to right-click a default category attribute and choose Move to Category to assign it to a category without dragging and dropping. The latter however results in an unexpected error in my IDE.
Now what happens when we open the application module tester ? It looks pretty much as expected right ?
From here I continue to create some extra categories in order to arrange the employee attributes into the appropriate groups. Be aware of the fact that you can also reorder categories (although this needs to be done in XML because the visual editor doesn’t seem to support this), and attributes within them. Here is the result with all categories.
And now for the UI
Now how can we use these categories in the User Interface ? For that we need to make use of Dynamic Forms. To be able to use dynamic forms you must add the “dynamic components” tag library to your project. In the Application Navigator, right-click the view project in which the dynamic components will be used, and from the context menu, choose Project Properties. In the tree, select JSP Tag Libraries. On the JSP Tag Libraries page, click Add. In the Choose Tag Libraries dialog, select ADF Dynamic Components, and click OK. On the JSP Tag Libraries page, click OK.
Create a new page, and from the Data Controls panel, now drag and drop the employees collection as a Dynamic Form. I had to re-start JDeveloper in order to have dynamic Form available, but hey, that only takes a few seconds with 11gR2.
In the Property Inspector, enter the following: for the Category field: “Job ” . Set “Editable” to true if you want the data to be editable (the default) or false if the data should be read-only. Repeat “drop as dynamic form and set category” for each group that you want to display on the form. When you run the page will see the result of the categories and Dynamic Forms. According to the documentation in the case of dynamic forms, the attributes from each category will appear in a separate tab. Doesn’t seem to happen, but order, grouping and UI Hints work ok.
Any help on the separate tab issue is welcome.