You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Petr Sakar <sa...@chare.cz> on 2005/08/18 18:13:07 UTC

How to edit different data with one page (basically multiple "instances" of one page) ?

Hello list,
newbie question:

I have a page with form to edits some data (eg. invoce1). How shall I do
it to be able to use the same page to edit different data (eg. invoice2)
at the same time, so I can edit both invoices simultanously ?

In different words user has two windows opened and works with both, both
windows are displaying the same page, just displayed data are diffferent
instance(record) of some class(table). Data are kept in session for
example as invoice1, invoice2.

Thanx for any ideas.

saki

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


Re: How to edit different data with one page (basically multiple "instances" of one page) ?

Posted by Howard Lewis Ship <hl...@gmail.com>.
Tapestry is somewhat more efficient.  When creating a
client-persistent page property, the properties are bundled together,
serialized to an object stream, optionally compressed, then MIME
encoded.  So you have a smaller number of much larger query
parameters. You also get some security-by-obscurity (at least enough
to keep it from prying eyes).

MB extended this, allowing for properties that stay persistent only as
long as you stay on a particular page, then are discarded.

On 8/18/05, Patrick Casey <pa...@adelphia.net> wrote:
> 
>         I used to be a firm believer in that camp as well, but I'm getting a
> bit more pragmatic in my old age. Keeping everything in the request can make
> for a nightmare of hidden fields and ridiculously long edit links and
> whatnot e.g. the "edit this dog" link has to encode:
> 
>         EditTarget=Dog
>         EditKey=42
>         PreviousSource=List
>         PreviousTarget=Dogs
>         PreviousQuery=Breed%"purebread"
>         PreviousSort=Weight
> 
>         It gets so that I'm passing around huge masses of data with every
> query that just feels excessive. That and my life gets annoying if I want to
> add a new field e.g.
> 
>         PreviousSortDirection=ASC
> 
>         So these days I'm using a hybrid between client and server
> persistence. Dunno if it's the ideal solution mind you, but it seems to work
> for me :).
> 
>         -- Pat
> 
> > -----Original Message-----
> > From: Paul Cantrell [mailto:cantrell@pobox.com]
> > Sent: Thursday, August 18, 2005 10:05 AM
> > To: Tapestry users
> > Subject: Re: How to edit different data with one page (basically multiple
> > "instances" of one page) ?
> >
> > The simpler approach may be to not use persistence at all -- make
> > everything request-based, and pass values through hidden fields as
> > necessary. Trying to make what you're describing work with the
> > session is possible, but will be a headache.
> >
> > This is a good general strategy. I prefer not to keep things in the
> > session unless they really belong there -- e.g. login, locale....
> >
> > Cheers,
> >
> > Paul
> >
> > On Aug 18, 2005, at 10:37 AM, Patrick Casey wrote:
> >
> > >
> > >     You're going to need to do your own persistence strategy. The
> > > simplest solution is just to put the unique key of each invoice in
> > > the edit
> > > form as a hidden field. If you put it on *top* of the form, then it
> > > is set
> > > first during the rewind and you can use its being set as a trigger to
> > > bootstrap the rest of the invoice out of persistent storage.
> > >
> > >     --- Pat
> > >
> > >
> > >> -----Original Message-----
> > >> From: Petr Sakar [mailto:saki@chare.cz]
> > >> Sent: Thursday, August 18, 2005 9:13 AM
> > >> To: tapestry-user@jakarta.apache.org
> > >> Subject: How to edit different data with one page (basically multiple
> > >> "instances" of one page) ?
> > >>
> > >> Hello list,
> > >> newbie question:
> > >>
> > >> I have a page with form to edits some data (eg. invoce1). How
> > >> shall I do
> > >> it to be able to use the same page to edit different data (eg.
> > >> invoice2)
> > >> at the same time, so I can edit both invoices simultanously ?
> > >>
> > >> In different words user has two windows opened and works with
> > >> both, both
> > >> windows are displaying the same page, just displayed data are
> > >> diffferent
> > >> instance(record) of some class(table). Data are kept in session for
> > >> example as invoice1, invoice2.
> > >>
> > >> Thanx for any ideas.
> > >>
> > >> saki
> > >>
> > >> ---------------------------------------------------------------------
> > >> 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
> > >
> > >
> > >
> >
> > _________________________________________________________________
> >
> > "I never let my schooling get in the way of my education."
> > -- Mark Twain
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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


RE: How to edit different data with one page (basically multiple "instances" of one page) ?

Posted by Patrick Casey <pa...@adelphia.net>.
	I used to be a firm believer in that camp as well, but I'm getting a
bit more pragmatic in my old age. Keeping everything in the request can make
for a nightmare of hidden fields and ridiculously long edit links and
whatnot e.g. the "edit this dog" link has to encode:

	EditTarget=Dog
	EditKey=42
	PreviousSource=List
	PreviousTarget=Dogs
	PreviousQuery=Breed%"purebread"
	PreviousSort=Weight
	
	It gets so that I'm passing around huge masses of data with every
query that just feels excessive. That and my life gets annoying if I want to
add a new field e.g.

	PreviousSortDirection=ASC

	So these days I'm using a hybrid between client and server
persistence. Dunno if it's the ideal solution mind you, but it seems to work
for me :).

	-- Pat

> -----Original Message-----
> From: Paul Cantrell [mailto:cantrell@pobox.com]
> Sent: Thursday, August 18, 2005 10:05 AM
> To: Tapestry users
> Subject: Re: How to edit different data with one page (basically multiple
> "instances" of one page) ?
> 
> The simpler approach may be to not use persistence at all -- make
> everything request-based, and pass values through hidden fields as
> necessary. Trying to make what you're describing work with the
> session is possible, but will be a headache.
> 
> This is a good general strategy. I prefer not to keep things in the
> session unless they really belong there -- e.g. login, locale....
> 
> Cheers,
> 
> Paul
> 
> On Aug 18, 2005, at 10:37 AM, Patrick Casey wrote:
> 
> >
> >     You're going to need to do your own persistence strategy. The
> > simplest solution is just to put the unique key of each invoice in
> > the edit
> > form as a hidden field. If you put it on *top* of the form, then it
> > is set
> > first during the rewind and you can use its being set as a trigger to
> > bootstrap the rest of the invoice out of persistent storage.
> >
> >     --- Pat
> >
> >
> >> -----Original Message-----
> >> From: Petr Sakar [mailto:saki@chare.cz]
> >> Sent: Thursday, August 18, 2005 9:13 AM
> >> To: tapestry-user@jakarta.apache.org
> >> Subject: How to edit different data with one page (basically multiple
> >> "instances" of one page) ?
> >>
> >> Hello list,
> >> newbie question:
> >>
> >> I have a page with form to edits some data (eg. invoce1). How
> >> shall I do
> >> it to be able to use the same page to edit different data (eg.
> >> invoice2)
> >> at the same time, so I can edit both invoices simultanously ?
> >>
> >> In different words user has two windows opened and works with
> >> both, both
> >> windows are displaying the same page, just displayed data are
> >> diffferent
> >> instance(record) of some class(table). Data are kept in session for
> >> example as invoice1, invoice2.
> >>
> >> Thanx for any ideas.
> >>
> >> saki
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >
> >
> >
> 
> _________________________________________________________________
> 
> "I never let my schooling get in the way of my education."
> -- Mark Twain
> 
> 
> 
> ---------------------------------------------------------------------
> 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: How to edit different data with one page (basically multiple "instances" of one page) ?

Posted by Paul Cantrell <ca...@pobox.com>.
The simpler approach may be to not use persistence at all -- make  
everything request-based, and pass values through hidden fields as  
necessary. Trying to make what you're describing work with the  
session is possible, but will be a headache.

This is a good general strategy. I prefer not to keep things in the  
session unless they really belong there -- e.g. login, locale....

Cheers,

Paul

On Aug 18, 2005, at 10:37 AM, Patrick Casey wrote:

>
>     You're going to need to do your own persistence strategy. The
> simplest solution is just to put the unique key of each invoice in  
> the edit
> form as a hidden field. If you put it on *top* of the form, then it  
> is set
> first during the rewind and you can use its being set as a trigger to
> bootstrap the rest of the invoice out of persistent storage.
>
>     --- Pat
>
>
>> -----Original Message-----
>> From: Petr Sakar [mailto:saki@chare.cz]
>> Sent: Thursday, August 18, 2005 9:13 AM
>> To: tapestry-user@jakarta.apache.org
>> Subject: How to edit different data with one page (basically multiple
>> "instances" of one page) ?
>>
>> Hello list,
>> newbie question:
>>
>> I have a page with form to edits some data (eg. invoce1). How  
>> shall I do
>> it to be able to use the same page to edit different data (eg.  
>> invoice2)
>> at the same time, so I can edit both invoices simultanously ?
>>
>> In different words user has two windows opened and works with  
>> both, both
>> windows are displaying the same page, just displayed data are  
>> diffferent
>> instance(record) of some class(table). Data are kept in session for
>> example as invoice1, invoice2.
>>
>> Thanx for any ideas.
>>
>> saki
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>

_________________________________________________________________

"I never let my schooling get in the way of my education."
-- Mark Twain



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


RE: How to edit different data with one page (basically multiple "instances" of one page) ?

Posted by Patrick Casey <pa...@adelphia.net>.
	You're going to need to do your own persistence strategy. The
simplest solution is just to put the unique key of each invoice in the edit
form as a hidden field. If you put it on *top* of the form, then it is set
first during the rewind and you can use its being set as a trigger to
bootstrap the rest of the invoice out of persistent storage.
	
	--- Pat

> -----Original Message-----
> From: Petr Sakar [mailto:saki@chare.cz]
> Sent: Thursday, August 18, 2005 9:13 AM
> To: tapestry-user@jakarta.apache.org
> Subject: How to edit different data with one page (basically multiple
> "instances" of one page) ?
> 
> Hello list,
> newbie question:
> 
> I have a page with form to edits some data (eg. invoce1). How shall I do
> it to be able to use the same page to edit different data (eg. invoice2)
> at the same time, so I can edit both invoices simultanously ?
> 
> In different words user has two windows opened and works with both, both
> windows are displaying the same page, just displayed data are diffferent
> instance(record) of some class(table). Data are kept in session for
> example as invoice1, invoice2.
> 
> Thanx for any ideas.
> 
> saki
> 
> ---------------------------------------------------------------------
> 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