Pages

Wednesday, March 19, 2008

Dynamic Adobe Flex Menu based on the Taskflow menu xml

In this blog I will show you how you can use Adobe Flex to create a flash menu which you can use in your JDeveloper 11g taskflow application. You only have to add this flash component to the jsf template. The Flash menu read the taskflow menu (root_menu.xml) and the adfc-config.xml file and generates the menu. You can the change the menu xml and the flash menu adapts to it. To get this working I need to read the adfc-config.xml too to know which url is connected with an action. How you can make a taskflow menu in JDeveloper 11g see my previous blog

With Flex you are very flexible to design you own menu or tabs. There are a lot of examples how you can archieve this. In this blog I made two menu's . The first is a menubar (horizontal ) and the second is a vertical menu.Here are some pics but you can make much shinier and glamorous. In my case I used different icons for group and menuitems. Here you see the menubar

This is the vertical menu

This is how it default looks with JDeveloper. With Flex you make tabs yourself with all the special features like an icon in the tab , hoovering , transparancy etc.This is an example of the root_menu.xml generated with JDeveloper and I changed it a little bit to make it more complex.

In the JDeveloper project I had to make two servlets which returns the root_menu.xml and the adfc-config.xml to the flash component because these file are located in the WEB-INF where I can't download them.

Now we can make a new project in Flex Builder 3. The result swf we have to put in the ViewController\public_html folder. Now we can add the flash object to the jsf template

These are the steps I did in flex. The first step is to read the xml's and generate a new flex menu xml. For every menuitem in the root_menu.xml I had to read the adfc-config to find the real url of this menuitem. The last step is to generate the menu's with the new menu xml. I also added an event to the menuitems so I know when an user a menuitem cliks so I can redirect them to the right place.

Download the jdeveloper 11g project here and here is the source code of flexTo make it work on your on pc change the weburl in the flex source and change the path of the root_menu.xml and adfc-config in the two servlets and it should work

No comments:

Post a Comment

ex Oracle ACE , Java Developer of the year 2009. Co-writer of the OSB Development Cookbook.I am working as a Software Architect and specialized in CI,CD, integration, middleware, security and web development.