Labs/Joey/clients/ajaxy/dojojoey

From MozillaWiki
< Labs‎ | Joey
Jump to: navigation, search

Dojo and Joey notes

History of Development ( problems solutions and notes )

1) Avoid genrating XHTML content with comments in it, Dojo contentpane XHR / parser will get the content as if it was not a comment. Example:

<!-- comments with CSS style rules in it >

It will be rendered as if it was not a comment. The thing is that Dojo loads the content into the XHR response buffer, parses it and applies to the document. So then some tags in comments will just show..

2) The dojo.io.FormBind can be used to intercept a form and mutate its action events so that the forms submit goes via the Dojo XHR infra. This is good for us, and help us to keep our aspect-driven approach.

3) setContent(String or DomNode); from contentpane. You can pass the fragment DOM Node or a string and it will parsed.

Optmizing a Build with Dojo

We may need to use Apache ANT and the source to create a custom optimized build. Some informaiton here ( custom build ) http://developer.iamalpha.com/dojo-intro

Documentation of Interesting things in Joey Ajaxy Client

ContentPane

Ref http://dojotoolkit.org/node/55

  • Ability to fetch dynamic content and apply it to the current document;
  • Good for accessing additional interfaces in the Joey flow;
  • Good for Next Previous buttons in a range list of dynamic retrieved elements;
  • Pluses - comes with built in "Loading.. " state signal;
  • Pluses - cache function , we may be able to store Previous panes in the list content
  • Pluses - executeScripts true - can execute scripts loaded with the content.

Dojo Forms

http://dojotoolkit.org/node/59

  • Form Bind - maps the traditional form to an XMLHTTPRequest. With this model, we can keep a FORM data in the client, and use it to create the transaction in the XHR channel. Would keep compability and probably would help us to keep the idea of an XHTML simplified + FORMS from CakePHP.
  • Form bind example http://mastodon.dojotoolkit.org/%7Edavid/formBind/

Dojo Events Connect

http://dojotoolkit.org/node/134

  • Additional on Events http://dojotoolkit.org/node/88
  • Dojo Events are general, for event flow control and an observation mechanism. Can be also used to listen to actual DOM UI events.

Dojo Undo

  • In the Dojo package, check tests/undo for the iframe history control information.

Dojo dojo.xml.XslTransform

  • ability to transform XML fragments in XML or XHTML fragments and attach to the docuemnt. This would be good if we want to keep some very lightweight encoded markup, then to transform in the dojo markup XHTML Div approach + classnames.

Dojo Events - Publish and Subscribe approach

{{{ var foo = new function() {

   this.init = function() {
       dojo.event.topic.subscribe("/mytopic", this, processMessages);
   }
   function processMessages(message) {
       alert("Message: " + message.content);
  }

}

var bar = new function() {

   this.showMessage = function(message) {
       dojo.event.topic.publish("/mytopic", {content: message});
   }

}

foo.init(); bar.showMessage("Hello Dojo Master"); }}}

Dojo Layout alignment facilities

  • With the contentpane works "left", "right", "bottom", "top", or "client" attribute layoutAlign see http://dojotoolkit.org/node/58 Layout section for more.