jMaki Get Widget Data Sample for Java

This sample shows how to retrieve data from the Dojo editor widget.  There are
two ways of getting the data from a widgetand both are shown here. First, you can 
use a function from the widget wrapper object to retrieve the data.  To this add 
JavaScript code to your application that looks up the editor widget and calls the
editor wrapper function to get the data.  In this case, the function is called when
the "Show editor content" button is clicked.  Second is to use the Glue
mechanism and add a listener the topic to get the data. The editor widget already
publishes a topic when the onSave event is triggered.  Here all the code is added
to the glue.js file.  The function is called when the users clicks on the save icon.
As an additional feature I added a timer such that periodically the contents of
the editor is retrieved.  This is done using the same handler only instead of 
looking up the contents directly it calls the editor saveState function which 
ends up in the handler again.

Although this sample uses the editor widget specifically, these techniques apply
to all widgets.

This application uses one of the provided layouts. Feel free to change it
to look as you like.


I. Deploying

Copy the jmaki-getwidgetdata.war file to the autodeploy directory of your 
web container or use the deployment tools that came with your web container
to deploy the war. The war requires J2EE 1.4 or better.

Now access the application at:

http://localhost:8080/jmaki-getwidgetdata

II. Resources

Find out more about jMaki at:

https://ajax.dev.java.net/about.html

Find out more about configuring Glue Code at:

https://ajax.dev.java.net/widget-developer.html#config

III. Feedback - Issues

Please see the jMaki Forums for issues or to give feedback.

http://forums.java.net/jive/forum.jspa?forumID=96