Does anybody have an example of how to execute javascript from an
EventListener in Tapestry 4.1?  I'd like to implement the Dialog from
tacos in T4.1 and also implement some of the tacos effects before
updating a component.

For instance, In tacos, in order to hide the dialog, a listener would
call the hide method, which looks like this:

public void hide()
   {
       //if (isHidden()) return;
       setHidden(true);
       AjaxWebRequest ajaxr = getAjaxRequest();
       if (ajaxr != null && ajaxr.isValidRequest()) {
           ajaxr.addPreProcessScript(generateHide(true));
           ajaxr.addPostProcessScript(initializeScript());
       }
   }

/**
    * Creates the javascript that will hide the dialog widget.
    * @return
    */
   protected String generateHide(boolean renderHide)
   {
       StringBuffer str = new StringBuffer();
       str.append("<script>\n");
       str.append("var cdialog = dojo.widget.byId(\"")
       .append(getId()).append("\");\n")
       .append("if (cdialog) {\n");
       str.append(" var ndialog = document.createElement(\"div\");\n")
       .append("ndialog.setAttribute(\"id\", \"").append(getId())
       .append("\");\n");
       str.append(" ndialog.style.display = \"none\";");
       str.append(" document.body.appendChild(ndialog);\n");
       if (renderHide) {
           str.append(" cdialog.hide(); \n");
       }
       str.append("}");
       str.append("</script>");
       return str.toString();
   }

What is the equivalent of AjaxWebRequest.addPreProcessScript() in Tapestry 4.1?

Thanks!
Joe

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to