On 7/13/05, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> Done (at least the draf) is the ajax handler stuff. To be done:
> - implement the model observer pattern;
> - implement a mechanism that allows components to indicate that they are
> 'dirty'/ should be re-rendered;
> - decouple the current rendering process so that components can be
> rendered on their own;
> - implement a render collection mechanism e.g. in the abstract ajax
> handler class. implement making a message of it, sending that message
> back to the client, and implement applying the changes to the page.

On 7/18/05, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> I think the concept of rendering a whole page as one continues process
> has to go anyway. Each component should be able to render just itself,
> and the rendering of the page is just rendering all the components.

I would like to chime in, maybe you find some useful ideas in the
approach that I use now. First of all, I use JSP. Second, I tried my
components with Ajax, and they work in "render HTML mode", see below.
So, here is the idea.

First, non-Ajax mode. 

A page consists of [probably independent] components. A component can
receive input, in this case it is rendered on HTML page as an HTML
form (or several forms). A component considers every POST as input; as
well as GET with parameters (in case of Wicket probably a GET with any
parameters except system parameters like component or whatever). GET
without parameters is considered as "Render yourself" phase.

When an HTML form corresponding to a component is submitted, the POST
request is sent to the component itself, not to the page that contains
it. This way, a page does not even know what components it consists
of. This is easy for JSP, just use <jsp:include>. I am not sure what
mechanizm can be used in Wicket.

After component updated its status, it redirects (here is the trick)
to the page, which contains it. The page is then loaded by browser
with GET, which means "Render yourself". Page pulls other components
with GET as well, and they render themselves. Simple.

For non-Ajax mode, it does not matter if a page consists of one
component only, or of several components. The name of master page is
set in configuration file, so a component does not know where it
redirects to.

Now, Ajax mode.

There are two choices: return rendered HTML or return some fancy
XML/DOM data. If an Ajax component can simply render itself by
returning HTML, then designing non-Ajax and Ajax components is
downrigh easy. For Ajax, a component should redirect to itself, which
would force it to render itself immediately. Master page is not
changed.

If component should return more advanced DOM data for Ajax mode, then
components should be Ajax-aware and to return different response for
Ajax and non-Ajax mode.

Wrapping up, there are two tasks:
* where to redirect in case of non-Ajax and Ajax;
* what to return in response.

Umm, that is all ;) just some raw food for thought :)

Michael.


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to