Skip to main content

Posts

ADF 11g Skinning: Three ways to change look and feel

On the JDeveloper ADF forum there are many questions on how to change the look and feel of components. In this post I'll explain three ways to do that. Setting skin Selector property For this we need to define a custom skin. <?xml version="1.0" encoding="ISO-8859-1"?> <skins xmlns="http://myfaces.apache.org/trinidad/skin"> <skin> <id>mySkin.desktop</id> <family>MySkin</family> <extends>blafplus-rich.desktop</extends> <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id> <style-sheet-name>skins/MySkin.css</style-sheet-name> </skin> </skins> In the style sheet we will add an entry that will hide the columnheaders. af|column::column-header-cell{display: none;} This entry in the styleSheet will apply to ALL columns in your application. Using and appending styleClasses Now we create a StyleClass that is exactly the same as the sty...

ADF 11g panelgroup: Tournament Layout

This is a short post on layout. With the quarter finals of the world cup 2010 coming up, it is time to show a simple layout example. A layout to show all teams and groups, competing in the world cup. This layout is achieved by af:panelgrouplayout, af:panelbox, and af:forEach. I read all the group data from a database table, and use the af:forEach to create a panelbox for each group. After that I use another af:forEach to add a line for every team in a group. <af:panelGroupLayout id="pgl1" layout="horizontal" inlineStyle="width:654px;"> <af:forEach var="group" items="#{bindings.ExistingGroups.rangeSet}"> <af:panelGroupLayout layout="vertical" id="pgl3"> <af:panelBox id="pb1" showHeader="always" showDisclosure="false" > <af:forEach items="#{bindings.GroupDraw.rangeSet}" var=...

ADF Mobile Client: Article on OTN - Developing Applications for the BlackBerry

After a couple of months of hard work, my article on developing ADF applications for blackberry smartphones finally made it to OTN. If you go to otn.oracle.com you cant' miss it. If it's gone by the time you read this, you can find the article right here .

ADF 11g popup and panelwindow: Open wikipedia in a modal popup.

This post was more or less inspired by the noteWindow example on Oracles tag demo site. When hovering the highlighted text in this example the user gets extra information about the subject. I wanted to give the end user the opportunity to get even more information, for instance by invoking a wikipedia page about the subject. The catch here is that I wanted this information to be shown in a modal popup, and one that is not prohibited by popup blockers. Luckily ADF 11g provides javascript popups that can also be made modal, so the user has to close the popup before returning to the application. This post describes how I used an in a to open the correct wikipedia in a modal popup. Step 1: Create the plain text that invokes the noteWindow. This is taken directly from the mentioned Oracle example. <p style="margin-left:30px;width:500px;margin-right:30px;line-height:16px"> Vultures are scavenging birds, feeding mostly on the carcasses of dead animals...

ADF 11g Contextual Event Framework: An Example

Often a page or a region within a page needs information from somewhere else on the page or from a different region. While you can pass parameters to obtain that information, doing so makes sense only when the parameters are well known and the inputs are EL-accessible to the page. Parameters are also useful when a task flow may need to be restarted if the parameter value changes. However, suppose you have a task flow with multiple page fragments that contain various interesting values that could be used as input on one of the pages in the flow. If you were to use parameters to pass the value, the task flow would need to surface output parameters for the union of each of the interesting values on each and every fragment. Instead, for each fragment that contains the needed information, you can define a contextual event that will be raised when the page is submitted. The page or fragment that requires the information can then subscribe to the various events and receive the information thr...

ADF 11g : Label Modifications and Persisting Resource Bundle Changes

In a comment on one of my posts on the AMIS technology blog I had a question on UIComponents. The question was if it is possible to modify prompts and labels of components programmatically. As a matter of fact this is possible. You can do this for the session only, or you can choose to persist these changes. In this post I first explain how to implement the "session only" functionality, and in the second part I explain how to use a persisted resource bundle with immediate refresh. Application Setup The application used in this post is based on the HR schema and the business components are created and not changed. First of all you create a page that is used to hold components of which you want to change labels and prompts. Create two panelboxes next to each other. In the first one drop the employees collection and in the second one drop the child employees collection. Drop both as read only form. When browsing the first box, the second one will show the subordinate employees ...

ADF 11g: My new publications.

I have had a very busy month. I spent most of my evenings writing. Writing code? Nope, writing text! It looked like it all came at the same moment. I had 3 deadlines in January, 2 of which were in the last week. One of the things I wrote was a blog post at the AMIS blog. It was a post that I started to write some time ago, but I never took the time to finish it. It describes how to create a dynamic updateable table. An overview of my blog-posts on the AMIS technology blog can be found here: http://technology.amis.nl/blog/author/luc The next one was for my own column in Optimize Magazine. As of this year (2010) I have a column about ADF in Optimize Magazine. The column is called ADF@WORK, and it is about the daily work with ADF. The first edition, which will be printed in the February issue, is about View Criteria, and how they can be used declaratively and programmatically. And as if that was not enough, I had the opportunity to write an article for OTN about a brand new ADF feature th...

ADF 11g RC: Manipulating a components toolbar.

Last week I had a question regarding the Rich Text Editor in ADF 11g RC. Is it possible to disable/enable or add/remove components form the rich text editor's toolbar? At first I didn't know the answer, but after some investigation it appears to be very simple. The most important piece of the puzzle is to understand how the toolbar is constructed. According to the components documentation, the toolboxLayout property allows control over the layout of the toolbar. This is actually just an Array of Strings. The built in strings the component recognizes are: 1) "all" 2) "font" 3) "history" 4) "color" 5) "formatAll" 6) "justify" 7) "list" 8) "indent" 9) "link" 10) "newline" 11) "stretch" For more information on what these built in Strings do, refer to the online help of the component. One of the options you have to change the toolbar is to bind the editor compone...

JHeadstart 11g TP - Magic with Wizards

One of the main features in ADF 11g is the use of taskflows. There are different kinds of taskflows. One of these is a process train. A process train (the ADF name for wizard) can be used to guide the end user step by step through a rather difficult process. In this post I describe how you can use JHeadstart to generate the wizard for you. The very difficult (duh) process in his case is the entry of a new employee. For that I need a three step wizard. The first steps are the same as always. Create a new fusion wep application, create new Business Components from tables, and only pick the Departments and Employees, enable JHeadstart on the view controller project, and finally create a new service definition for the datacontrol (accept al the defaults). According to JHeadstart help, to spread items of one group over multiple wizard pages, you should place the items in an item region and set the layout style of the regions container to "separatePages". Let's do that. Creat...

JHeadstart 11g TP - Master Detail and Overflow

I have been working with JHeadstart 11g technical preview a lot lately. I want to share some of the features with you in a series of articles. Luckily Oracle allowed me to blog about the JHeadstart 11g technical preview. It is a technical preview, but is already pretty mature. Let's start with some basic generation. In this blog I describe how easy it is to create a layout in which a master-detail relation is generated into a form - table layout. I use the DEPT-EMP relation we probably all know. In the model project just create new Business Components from tables, and only pick the Departments and Employees. In the JHeadstart Application Definition Editor, you can now create a new Group, based on the Departments collection. Also create a detail Group based on the Employees group. It should look somewhat like this. Before you generate, make sure that the layout style for the departments group is form. Also set layout style for employees to table, put this group on the same page, and...

Back again

Almost two years ago I published my last post here. What happened in these two years? Did I quit developing ADF applications? Nope! I've been very busy on my new job. I started at AMIS Technology as an ADF expert and I've also been working with JHeadstart. It still is a great job, so that's not the reason that I am back here. It's just that it would be a shame if my own weblog should die........... That's why I'm back again. Here's what I published and presented the last two years: Presentation and workshop on ADF: November 17th 2008: ADF 11g Hands on (in Dutch). Publications on ADF: June 2008: Optimize: ADF 11g Data Visualization Tools (in Dutch). Optimize is an independent Dutch magazine on Oracle technology. January 2009: OGH-visie: ADF 11g (in Dutch). OGH-visie is the magazine of the Dutch Oracle user group. August 2009: DOAG-magazine: ADF 11g Data Visualization Tools (in German and English). DOAG-magazine is the magazine of the German Oracle user g...

Changing appearances.

Lately I've been working on an application that can serve offices in different countries. So what I hear you say.........I do that every day.............use the 'locale.language', use a bundle and be happy ;-) Ok, I know that, but I want to have changing appearances, not only changing text. That can also be done by using a skin selector for instance like the one below: <skin-family>#{facesContext.viewRoot.locale.language=='de' ? 'german' : 'english'}</skin-family> You can use this in the same way as I did in one of my previous posts. However, I want the application to behave in a way that not the whole look and feel changes, but that only some country specific elements automatically change. I will not go in to the details of the application, but I will try to explain the concept, based on license plates. Imagine a car rental company with cars and offices in different countries. Whatever country (or even state for that matter) you are in,...

Hibernate untill your ADF-faces Spring (part II)

If you are an ADF developer with an Oracle forms background, you've probably been using ADF Business Components to implement the business and integration layer of your webapplications. So have I. Hibernate was new to me, and I will try to explain just a little bit in this post. I have some very good developers in my team that do the hard work on the hibernate part of this project. I will keep it simple and just explain some of the basics. The persistence layer contains a set of classes and components, which handle the tasks of persisting or retrieving objects to or from the underlying database. This layer includes a domain model that includes the business entities. Hibernate is a typical example for technologies used in this layer. There is a thing to keep in mind. You don't write sql queries. The hibernate framework will generate those for you. This is called "Hibernate Query Language" (HQL). The generated Language is based on the tye of database that you are conne...

Hibernate untill your ADF-faces Spring (part I)

It's october and summer ended a couple of weeks ago. A lot of rodents and bears prepare for winter and hibernation. So will I! I got involved in a project in which creativity was pushed to the limit in a very early stage. We wanted to do a project with ADF (full framework) for one of our customers. This approach wasn't allowed. I've been mailing and talking about this case with some people at oracle (Steve Muench a.o.) but it is at it is...Either you like it or you don't. There are customers who, for whatever good reason, don't want to use ADF. John Stegeman wrote a nice entry on his blog about the pro's and cons, and about 'pride and prejudice' concerning JDeveloper and ADF. In this case however, instead of forbidding the use of any part of the ADF, my customer decided to allow a Poc (Proof of Concept) in which I (and my co-workers) were allowed to use the ADF-faces part of the framework. The consequence was that we had to think of an alternative appli...