jMaki Extension for Google Gears

Written by on June 12th, 2007 in Ajax News.

Greg Murray has posted his jMaki Extension for Google Gears.

He details the steps required to create an extension for jMaki, and then showed an example of mapping the save button for the Dojo Editor and Dojo Inline Edit components which publish to the topic “*onSave”.

JAVASCRIPT:

  1.  
  2. jmaki.addGlueListener(”*onSave”, function(args) {
  3.     // publish to the google gears
  4.     jmaki.publish(”/google/gears/execute”,
  5.     { query : ‘insert into jmaki values (?, ?)’,
  6.       args : [args.value, new Date()],
  7.      callback : function() {
  8.          jmaki.log(”Saved ” + args.value);
  9.      }
  10.     });
  11. });
  12.  

The returned value is assigned to the global variable window.editorData which you can then assign to your widget. For a Editor you can assign a JavaScript variable as the value using a client side value binding which starts with an ‘@{’ and contains the package and variable name and ends with an ‘}’. For this window.editorData the client side value binding is @{window.editorData}. With a JSP / JSF widget the tag in a JSP page would look like the following:

JAVASCRIPT:

  1.  
  2. <a :widget name=”dojo.editor” value=”@{window.editorData}” />
  3.  

Source: Ajaxian
Original Article: http://ajaxian.com/archives/jmaki-extension-for-google-gears

Leave a Reply

You must be logged in to post a comment.



Site Navigation