jMaki Get Widget Data Sample for PHP

This sample shows how to retrieve data from the Dojo editor widget.  There are
two ways of getting the data from a widget and both are shown here. First, you can 
add 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.  The second approach is to use the Glue
mechanism and add a listener in the glue code which listens on the topic to get the data. 
This second approach is recommended.  The editor widget already
publishes a topic when the onSave event is triggered and in our case this ends up
in the listener code. 

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.zip 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
