There are a large number of well-built and tested JavaScript widgets available, that can be integrated with Jaxcent.

This page shows the integration of Jaxcent with two menu systems:


How To

The vendors provide instructions on customizing the menu systems. These instructions can be followed even by people not familiar with CSS or JavaScript.

During these customization instructions, at some point, you will be asked to provide a link for action. Usually, this will be of the form

    http://www.somedomain.com/somelink

Instead of the http link, simply put in

    javascript:JaxcentServerRequest('Some.Link');
replacing 'Some.Link' with some appropriate string. What string you choose is up to you, but you will be handling the same string in Java. [Note: For the top-down menu shown here, the items are in menu_item.js. For the slide-out menu, they are embedded in the HTML.]

On the Jaxcent side, override the onJavaScriptRequest of the JaxcentPage class, to retrieve the string passed in from the JavaScript side. You can provide more than one arguments in the javascript call. Additional arguments will be provided as a String-array on the Java side. The Java side can then take the appropriate action based on the string that came in.

The Java code that handles this page is provided below:


package sample;

public class MenuSample extends jaxcent.JaxcentPage {

    protected void onJavaScriptRequest(java.lang.String cmd, java.lang.String[] args)
    {
        showMessageDialog( "Server received cmd: " + cmd );
    }
}