You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Patrick Casey <pa...@adelphia.net> on 2005/08/15 17:21:54 UTC

More Partial Form Stuff

 

            Is anyone here pretty familiar with the way the Tacos library
implemented Partial Forms? If so, could you reality check me on how I
*think* the implementation was managed? I've done a fair amount of AJAX
stuff, but that was all with my own servlets and my own javascript, so I'm
familiar with the core concepts, but I'm a bit fuzzy on how exactly the
tacos components implemented them.

 

            So, is this the proper model:

            

1)       A Partial Form is posted. The javascript takes the contents of the
form, builds and encoded POST string, and calls it.

2)       Tapestry catches the POST and redirects it to the appropriate
listener.

3)       Tapestry listener implements POST.

4)       Tapestry rebuilds *entire page* on server.

5)       Tapestry returns entire page.

6)       Javascript recognizes POST has completed.

7)       Javascript parses result string.

8)       Javascript plucks out any divs that are on the list of divs to be
updated.

9)       Javascript replaces current document's version of that div with the
div that came out of the response.

 

 

As you can tell from the bolding, I'm concerned about step 4. Unless I'm
mistaken (which wouldn't be the first time), this particular AJAX
implementation isn't going to save me anything on page render time because
even if I'm only updating a small div in the middle of the form, Tapestry
still has to render the entire form and return it. So the only thing I'm
really saving on is the "screen flicker" associated with a complete redraw.
In terms of server side resources and network resources, I'm still A)
building the whole form and B) sending the whole form.

 

Am I wrong here? Is there some alternative approach to make tacos just
render (and respond with) the divs its interested in?

 

--- Pat


Re: More Partial Form Stuff

Posted by Adam Greene <ag...@iq-2000.com>.
Basically, your theory stands.  I'm not sure about step 4.  But you save on 
the fact that the code plucking occurs on the server side, it simply sends 
back an XML document that contains elements with the same names as the 
replaced DIVs, not the entire page.

----- Original Message ----- 
From: "Patrick Casey" <pa...@adelphia.net>
To: "'Tapestry users'" <ta...@jakarta.apache.org>
Sent: Monday, August 15, 2005 12:21 PM
Subject: More Partial Form Stuff


>
>
>            Is anyone here pretty familiar with the way the Tacos library
> implemented Partial Forms? If so, could you reality check me on how I
> *think* the implementation was managed? I've done a fair amount of AJAX
> stuff, but that was all with my own servlets and my own javascript, so I'm
> familiar with the core concepts, but I'm a bit fuzzy on how exactly the
> tacos components implemented them.
>
>
>
>            So, is this the proper model:
>
>
>
> 1)       A Partial Form is posted. The javascript takes the contents of 
> the
> form, builds and encoded POST string, and calls it.
>
> 2)       Tapestry catches the POST and redirects it to the appropriate
> listener.
>
> 3)       Tapestry listener implements POST.
>
> 4)       Tapestry rebuilds *entire page* on server.
>
> 5)       Tapestry returns entire page.
>
> 6)       Javascript recognizes POST has completed.
>
> 7)       Javascript parses result string.
>
> 8)       Javascript plucks out any divs that are on the list of divs to be
> updated.
>
> 9)       Javascript replaces current document's version of that div with 
> the
> div that came out of the response.
>
>
>
>
>
> As you can tell from the bolding, I'm concerned about step 4. Unless I'm
> mistaken (which wouldn't be the first time), this particular AJAX
> implementation isn't going to save me anything on page render time because
> even if I'm only updating a small div in the middle of the form, Tapestry
> still has to render the entire form and return it. So the only thing I'm
> really saving on is the "screen flicker" associated with a complete 
> redraw.
> In terms of server side resources and network resources, I'm still A)
> building the whole form and B) sending the whole form.
>
>
>
> Am I wrong here? Is there some alternative approach to make tacos just
> render (and respond with) the divs its interested in?
>
>
>
> --- Pat
>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: More Partial Form Stuff

Posted by Norbert Sándor <de...@erinors.com>.
I've been playing with this quite much because one of my applications has 
similar requirements (very big and complex form but parts of the form should 
be partially refreshable).
It is more complex than I thought: the biggest problem is what Viktor wrote, 
hidden fields generated by the components. For example LinkSubmit, 
FormConditional (If), ListEdit (For) cannot be used as normal.

Although if you need only simple things it can be done with not too much 
work.
Simple means that you want to render no component that creates hidden fields 
(for example only simple input fields like textfield, combobox). In this 
case you should update only the one hidden field in which Tapestry stores 
component IDs for rewinding.

I'm working on this but don't expect more concrete things soon because my 
holiday starts this week :)

BR,
Norbi

----- Original Message ----- 
From: "Viktor Szathmary" <ph...@gmail.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Monday, August 15, 2005 7:05 PM
Subject: Re: More Partial Form Stuff


hello,

On 8/15/05, Patrick Casey <pa...@adelphia.net> wrote:
>
>         I have two forms, one big one, one little one.
>         I use the small partial form to update a div within the big form.
>         I then (later) submit the big form.
>         I get a stale link because the big form has a different widget 
> count
> than it did when originally rendered.

Tacos is not currently capable of dynamically chaning forms due to the
component-list hidden field that Tapestry requires. There's some
work-in-progress from a contributor on this, but don't count on this
quite yet :)

  viktor

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org






---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: More Partial Form Stuff

Posted by Viktor Szathmary <ph...@gmail.com>.
hello,

On 8/15/05, Patrick Casey <pa...@adelphia.net> wrote:
> 
>         I have two forms, one big one, one little one.
>         I use the small partial form to update a div within the big form.
>         I then (later) submit the big form.
>         I get a stale link because the big form has a different widget count
> than it did when originally rendered.

Tacos is not currently capable of dynamically chaning forms due to the
component-list hidden field that Tapestry requires. There's some
work-in-progress from a contributor on this, but don't count on this
quite yet :)

  viktor

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: More Partial Form Stuff

Posted by Adam Greene <ag...@iq-2000.com>.
Any time you change the number of components in the form without rerendering 
the page, you will invalidate the form.  There is a field within the page 
that stores the number of components that will need to be changed (and as of 
Tapestry 4.0, I think that field may now be DataSqueezed, someone else can 
set me straight on that one).

----- Original Message ----- 
From: "Patrick Casey" <pa...@adelphia.net>
To: "'Tapestry users'" <ta...@jakarta.apache.org>
Sent: Monday, August 15, 2005 1:49 PM
Subject: RE: More Partial Form Stuff


>
> Thanks Viktor, that helped reduce the amount of rendering I'm doing.
> Unfortunately, I ran into a different problem that I'm not sure is 
> solvable.
>
> I have two forms, one big one, one little one.
> I use the small partial form to update a div within the big form.
> I then (later) submit the big form.
> I get a stale link because the big form has a different widget count
> than it did when originally rendered.
>
> I think for what I'm doing I'm just not going to be able to use this
> implementation of partial form unfortunately. Now that I understand it
> better, I can see uses for it, but it doesn't match up well with my use
> case.
>
> --- Pat
>
>> -----Original Message-----
>> From: Viktor Szathmary [mailto:phraktle@gmail.com]
>> Sent: Monday, August 15, 2005 9:03 AM
>> To: Tapestry users
>> Subject: Re: More Partial Form Stuff
>>
>> hello,
>>
>> On 8/15/05, Patrick Casey <pa...@adelphia.net> wrote:
>> >
>> >
>> > mistaken (which wouldn't be the first time), this particular AJAX
>> > implementation isn't going to save me anything on page render time
>> because
>> > even if I'm only updating a small div in the middle of the form,
>> Tapestry
>> > still has to render the entire form and return it. So the only thing 
>> > I'm
>> > really saving on is the "screen flicker" associated with a complete
>> redraw.
>> > In terms of server side resources and network resources, I'm still A)
>> > building the whole form and B) sending the whole form.
>>
>> That is generally true - with the tapestry rendering lifecycle you
>> can't jump in to the middle of the rendition cycle, things could
>> easily break... However, Tacos will skip rendering for Parts that have
>> optimize="true" set and are not needed for the current request. Read
>> the docs on the optimize parameter.
>>
>> hope this helps,
>>   viktor
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: More Partial Form Stuff

Posted by Patrick Casey <pa...@adelphia.net>.
	Thanks Viktor, that helped reduce the amount of rendering I'm doing.
Unfortunately, I ran into a different problem that I'm not sure is solvable.

	I have two forms, one big one, one little one.
	I use the small partial form to update a div within the big form.
	I then (later) submit the big form.
	I get a stale link because the big form has a different widget count
than it did when originally rendered.

	I think for what I'm doing I'm just not going to be able to use this
implementation of partial form unfortunately. Now that I understand it
better, I can see uses for it, but it doesn't match up well with my use
case.

	--- Pat

> -----Original Message-----
> From: Viktor Szathmary [mailto:phraktle@gmail.com]
> Sent: Monday, August 15, 2005 9:03 AM
> To: Tapestry users
> Subject: Re: More Partial Form Stuff
> 
> hello,
> 
> On 8/15/05, Patrick Casey <pa...@adelphia.net> wrote:
> >
> >
> > mistaken (which wouldn't be the first time), this particular AJAX
> > implementation isn't going to save me anything on page render time
> because
> > even if I'm only updating a small div in the middle of the form,
> Tapestry
> > still has to render the entire form and return it. So the only thing I'm
> > really saving on is the "screen flicker" associated with a complete
> redraw.
> > In terms of server side resources and network resources, I'm still A)
> > building the whole form and B) sending the whole form.
> 
> That is generally true - with the tapestry rendering lifecycle you
> can't jump in to the middle of the rendition cycle, things could
> easily break... However, Tacos will skip rendering for Parts that have
> optimize="true" set and are not needed for the current request. Read
> the docs on the optimize parameter.
> 
> hope this helps,
>   viktor
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: More Partial Form Stuff

Posted by Viktor Szathmary <ph...@gmail.com>.
hello,

On 8/15/05, Patrick Casey <pa...@adelphia.net> wrote:
> 
> 
> mistaken (which wouldn't be the first time), this particular AJAX
> implementation isn't going to save me anything on page render time because
> even if I'm only updating a small div in the middle of the form, Tapestry
> still has to render the entire form and return it. So the only thing I'm
> really saving on is the "screen flicker" associated with a complete redraw.
> In terms of server side resources and network resources, I'm still A)
> building the whole form and B) sending the whole form.

That is generally true - with the tapestry rendering lifecycle you
can't jump in to the middle of the rendition cycle, things could
easily break... However, Tacos will skip rendering for Parts that have
optimize="true" set and are not needed for the current request. Read
the docs on the optimize parameter.

hope this helps,
  viktor

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org