Friday, October 16, 2009

Missing javascript

I think there are some important things missing from Tapestry.js to release the full potential of Tapetsry 5 and AJAX. I have started working on a javascript class, TapestryExt, that extends the functionality of Tapestry.js.

My wish is to see all of this and more built in to tapestry.


 * Commonly needed functions that are absent in the default Tapestry js lib.
var TapestryExt = {
   * If the specified form listens for the Tapestry.FORM_PROCESS_SUBMIT_EVENT event
   * (all forms with a zone specified do), it will AJAX-submit and update its zone after.
  submitZoneForm : function(element) {    
    element = $(element)
    if (!element) {
      Tapestry.error('Could not find form to trigger AJAX submit on');
   * Trigger any link, zone or not. 
   * If no url is provided, the href attribute of element will be used.
  triggerLink : function(element, url) {
    element = $(element);
    if (!url) {
      url = element.href;
    if (!url) {
      Tapestry.error('Unable to find url to trigger on element ' +;
    var zoneObject = Tapestry.findZoneManager(element);
    if (zoneObject) {    
    else {
      // Regular link
      // Note: this will skip all event observers on this link!
      window.location.href = url;


  1. hi! Thanks for your share!it's really help me!

    I got learn more tapestry native javascript!
    in the js code:
    submitZoneForm is a listen function.
    and triggerLink look like a link's callback function.
    hwo to use them together?
    please give me a exmaple!
    thank again!

  2. Great additions! Have you filed a JIRA issue on this?