Adam Zastawski

My Personal Blog

Office Style Menus in TIBCO General Interface

Posted by Adam

Recently I got into a 'Usability' debate about what sort of menus where better; 'Office Like' menus or basic drop-down fly-out menus with tool tips.  I was thinking about it and I started to wonder if it was even possible in my favorite AJAX web UI development environment (General Interface).

The answer is yes, of course, and there are a number of ways in which it could be accomplished.  I chose to try it by re-writing the XSL that is used to render the Menu GUI component. You will have to realize that GI is alien technology reverse engineered by time traveling browser ninjas and the XSL method is the one that I felt was the most elegant. It is not the easiest way I can think of.

I have to admit that this example is incomplete for two reasons:

  1. I don't have any real business case for implementing this at this time.  I am perfectly happy with the default menus for now.
  2. I am feeling very lazy tonight.

In the image below you will see an example of some of the menus in Office that I am talking about. They have a large graphical icon and two types of text, a bolded title and a non-bolded description.

image

Here is an example of the menus that I made by altering the default XSL for the menu component in GI.

image

  1. Copy the default XSL file from the GI runtime folder..(/JSX/xsl/jsxmenu.xsl) to the XSL folder under your current project.
  2. Alter the XSL file to show the menus the way you want them to.
  3. Then create an XML document using the GI 'Common Data Format' or CDF
    <data jsxid="jsxroot">
    <record jsxid="1" jsxtext="New" jsxtip="Tool Tip Here" jsxkeycode="ctrl+e" jsximg="images/paint_24.png" jsxexecute="alert('New Clicked');"/>
    <record jsxid="2" jsxtext="Open" jsxtip="Tool Tip Here also" jsximg="images/flag_24.png" jsxexecute="alert('Open Clicked');">
        <record jsxid="21" jsxtext="Open Sub 1" jsxtip="SubTip Here" jsxexecute="alert('Open Sub Clicked');"/>
    </record>
    <record jsxid="3" jsxtext="Save" jsxtip="Another Tool Tip here and this one is really lot of text." jsximg="images/foldr_24.png" jsxkeycode="ctrl+q" jsxexecute="alert('Save Clicked');"/>
    </data>

    Pay special attention to the 'jsximg', 'jsxexecute', 'jsxkeycode', and 'jsxtip' attributes. I chose to use the tool tip data as the description text. I could have used a custom attribute but I got lazy again.
  4. Apply the contents of this XML file to the 'XML String' property of the menu. You can also apply the path to this document in the 'XML URL' property but I am finding that the HOT KEYs (see jsxkeycode attribute) are not working when I do that. I have brought this up in the forum.
  5. I then copied some random icons into my local project and made sure the 'jsximg' attribute in the XML document was correct.

You can download the project and see what all was done to the XSL. Enjoy....

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Posted on: 2/29/2008 at 11:41 PM
Tags: , ,
Categories: AJAX | RIA | Tibco - GI
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (2) | Post RSSRSS comment feed

Related posts

Comments

Jesse Foster us

Saturday, March 01, 2008 4:43 PM

Jesse Foster

Very cool.

luke us

Friday, March 07, 2008 10:33 AM

luke

Adam,

I really like the approach, but I'm surprised at your courage to dig through the XSLT. If you want to change the background for the menu, you can do so, using the Menu class variable, DEFAULTBACKGROUND. For example, executing the following before showing any menu will change the background property for the menu dropdown to use a rainbow-colored PNG:

jsx3.gui.Menu.DEFAULTBACKGROUND = "background-image:url(" + jsx3.resolveURI("jsx:///images/colorpicker/hue-v.png") + ");background-repeat:repeat-y;";

Very nice insight.

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

Wednesday, July 23, 2008 1:06 PM