Bernard <bernard <at> man.poznan.pl> writes:

> 
> Beat Hoermann wrote:
> > I surrounded the form component with a shell component. After all, my tiny 
web-
> > app, just displaying a simple text field and a submit button, not using 
ajax 
> > nor any dojo things, was forced to load the 173 KByte heavy "dojo.js". The 
> > integration of dojo into Tapestry seems quite invasive to me.
> 
> Take look at this (Shell component): 
> <http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-
framework/src/java/org/apache/tapestry/html/Shell.jwc?view=markup>
> 
> it is my guess, that you need to set "ajaxEnabled" parameter to false 
> (true is default).
> 
> Jesse, I wouldn't be so eager to enable Ajax on default. Ajax is cool 
> but I'd rather have working version of plain html app first, than 
> fiddling with JS code which may not work on all browsers. After all, 
> good UI design principle says that you should provide alternative with 
> non-JS UI when the JS is disabled. Will 4.1 components do that?
> 
> I would rather  to work like that: if I include Ajax enabled component 
> it would include required JS scripts (with unique). No ajax enabled 
> components used - no redundant js included.
> 
> Beat, your example is of "pet-shop" kind but I agree that is a little 
> bit of overkill. The good side is that browser caches JS so it would be 
> downloaded once :)
> 
> Best regards,
> Bernard
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe <at> tapestry.apache.org
> For additional commands, e-mail: users-help <at> tapestry.apache.org
> 
> 

Thank you for your answer! Good to know about these parameters.

The point is more critical: Tapestry now forces you to load the dojo-
infrastructure ("dojo.js") even if you do not want/need it. Switching off the 
loading of the "dojo.js", as you described, is not a solution.

Take the following template:

<html>
   <head>
      <title>Tapestry 4.1 Test </title>
   </head>
   <body jwcid="@Body">
      <form jwcid="@Form" success="listener:doSubmit">
         <input jwcid="@TextField" value="ognl:input" />
         <input type="submit" value="Submit"/>
      </form>
   </body>
</html>

The corresponding java file:

public abstract class Home extends BasePage {
        private String input = "";
        
        public abstract String getInput();
        public abstract void setInput(String input);
        
   public void doSubmit() {
      // do some side-effects
   }
}

The rendered output contains:

...
<script type="text/javascript"><!--
dojo.event.connect(window, 'onload', function(e) {
dojo.require("tapestry.form");tapestry.form.registerForm('Form');
});
...

Thus, even in a "standard" web-app, displaying just a form, the dojo-
infrastructure must be loaded. Why?

To make things clear: The "dojo.js" needs 173 KByte space. Take an average 
bandwith of 128 Kbit = 16 KByte per second. Loading the "dojo.js" then takes 
11 seconds -> not the reaction you expect from a thin client web-app. On the 
other hand, 11 seconds are okay for a fatter, rich client web-app based on 
dojo components.

It is unclear to me where XHR (aka ajax) begins and where it ends in Tapestry 
4.1. The same for dojo. Of course, dojo uses XHR-communication, but does 
Tapestry support me writing an XHR-web-app *without* using the dojo-
infrastructure and without writing dynamic scripts?

Curious to know about that as Tapestry 4.1 evolves...


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

Reply via email to