Saturday, February 2, 2013

Custom ADF Faces Client Behavior 11.1.1 JSP tag

This post will show how to create your own ADF Faces client behavior JSP tags which makes them suitable for ADF version 11gR1, also known as version 11.1.1, and version 11gR2 (11.1.2) when not using Facelets.

ADF Faces client behavior tags provide declarative solutions to common client operations that you would otherwise have to write using JavaScript, and register on components as client listeners.

Using tags makes behavior much more reusable. All a page developer has to do is drag-and-drop the client behavior tag on the appropriate component and not worry about writing JavaScript and attaching the appropriate client listeners. ADF Faces 11gR1 has a number of client behavior tags and a couple more were added in version 11.1.2. Some examples are the af:showPopupBehavior to disclose a popup or the af:scrollComponentIntoViewBehavior to scroll the page.

Wouldn't it be great if we can create our own client behavior tags for things that ADF doesn't support out of the box? There are a number of blogs out there that describe something like that, such as placeholder watermarks by Duncan Mills and setting the initial focus component by Donatas Valys. Unfortunately those blogs describe how to do this with facelets which requires JDeveloper 11.1.2 We needed a solution for JDeveloper 11.1.1 and thus JSP tags.

Update: A follow-up post is available that explains how to add support for attributes to your custom client behavior.

Friday, February 1, 2013

Deploy a simple ADF application to Oracle Cloud

I write sample applications to accompany blog posts. You can typically download the project as a zip file or get access to the subversion repository. But I also wanted to make it as easy as possible for people to see the running application. This where the Oracle Cloud comes in. I currently still have a free trial java cloud and this posts explains how I deployed one of the sample applications to that cloud.

First thing you need is the latest version of JDeveloper 11.1.1.6. If you already have JDeveloper installed be sure to check Help > About for the version number. For reasons beyond my comprehension Oracle decided to give the JDeveloper version with cloud support the same version number. The one you need is build 6229 and not the original build 6192: