You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Edward Scanzano <es...@yahoo.com> on 2005/08/17 20:19:57 UTC

Please expand on this

Hi All (and Dario),

How am I supposed to access the value of a field on
the form from within the java code if it is not in a
form post?

I find it hard to believe that when Tapestry persists
the state of a page it does not attach it to an
instance of a page. This makes supporting backing a
real pain and basically my responsibility.

Do I have this right.





This is expected behavior. If your parameters are
persisted, then they
will have the last value they were set to, regarding
of how many
"backs" you perform.

You need to use Hidden fields to avoid this.


On 8/10/05, Edward Scanzano <es...@yahoo.com>
wrote:
> Hi all,
> 
> I have a page when have a number of components that
> are passed parameters which are persisted in the
page.
> This page has an initialization method this is
called
> as follows.
> 
> CWorkspace page = (CWorkspace)
> cycle.getPage("CWorkspace");
> page.setup((Container)item,null);
> 
> So far, no problem.
> 
> The user then performs a click with in one of these
> components and the same page is called on this time
> with a new object passed to the setup method.
> 
> So far, no problem.
> 
> Now, I back on the browser to the first page and
when
> I click on another link, the components are seeing
the
> data passed to them from the second page. It is as
if
> the page did not have its persistant variables reset
> for page 1. They remain for page 2.
> 
> What is causing this and how should I fix it.
> 
> Thanks
> E
> 
> 




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


Re: Please expand on this

Posted by Edward Scanzano <es...@yahoo.com>.
Thanks all for this info. I will upgrade now.

E

--- Jesse Kuhnert <jk...@gmail.com> wrote:

> Yes :) You should upgrade. 
> On 8/17/05, Edward Scanzano <es...@yahoo.com>
> wrote:
> > client-persistent page properties? What are they?
> > 
> > Is that a T4 feature?
> > 
> > E
> > 
> > --- Howard Lewis Ship <hl...@gmail.com> wrote:
> > 
> > > This kind of navigation context is ideal for
> > > handling via
> > > client-persistent page properties.
> > >
> > > On 8/17/05, Patrick Casey
> <pa...@adelphia.net>
> > > wrote:
> > > >
> > > >         What I ended up doing was rolling my
> own
> > > persist layer. The tapestry
> > > > persist layer persists on the session/page
> level,
> > > which falls apart if you
> > > > have multiple instances of the same page up
> e.g.
> > > >
> > > >         List of Dogs
> > > >         Right Click -> Open in new Window ->
> > > Poodle
> > > >         Right Click -> Open in new Window ->
> > > Rotwilder
> > > >         Click on poolde form.
> > > >         Name it muffy.
> > > >         Push save.
> > > >
> > > >         Congrats, your rotwilder is now named
> > > muffy.
> > > >
> > > >         I ended up having to put a hidden
> keyfield
> > > atop each and every one
> > > > of my edit forms and then bootstrapping the
> form
> > > back based on that key.
> > > > Intitially I was just stuffing the ID value of
> > > whatever was getting edited,
> > > > but it turns out in practice you usually need
> to
> > > persist more than that e.g.
> > > > what page do I redirect to *after* a save? The
> > > user expects to go back to
> > > > the list, etc.
> > > >
> > > >         So what I do is generate a
> > > "pesistencecontext" object for each form
> > > > and then save it in a LRU cache in the session
> > > (with a unique key). This key
> > > > to this context goes out with each edit form
> on
> > > *top* of the form so it
> > > > rewinds first, and then I rebuild form state
> in
> > > the setPersistKey()
> > > > function.
> > > >
> > > >         Sort of awkward to describe, but once
> you
> > > get it in place it works
> > > > pretty well.
> > > >
> > > >         --- Pat
> > > >
> > > > > -----Original Message-----
> > > > > From: Edward Scanzano
> > > [mailto:escanzano@yahoo.com]
> > > > > Sent: Wednesday, August 17, 2005 11:20 AM
> > > > > To: tapestry-user;
> dario.vasconcelos@gmail.com
> > > > > Subject: Please expand on this
> > > > >
> > > > > Hi All (and Dario),
> > > > >
> > > > > How am I supposed to access the value of a
> field
> > > on
> > > > > the form from within the java code if it is
> not
> > > in a
> > > > > form post?
> > > > >
> > > > > I find it hard to believe that when Tapestry
> > > persists
> > > > > the state of a page it does not attach it to
> an
> > > > > instance of a page. This makes supporting
> > > backing a
> > > > > real pain and basically my responsibility.
> > > > >
> > > > > Do I have this right.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > This is expected behavior. If your
> parameters
> > > are
> > > > > persisted, then they
> > > > > will have the last value they were set to,
> > > regarding
> > > > > of how many
> > > > > "backs" you perform.
> > > > >
> > > > > You need to use Hidden fields to avoid this.
> > > > >
> > > > >
> > > > > On 8/10/05, Edward Scanzano
> > > <es...@yahoo.com>
> > > > > wrote:
> > > > > > Hi all,
> > > > > >
> > > > > > I have a page when have a number of
> components
> > > that
> > > > > > are passed parameters which are persisted
> in
> > > the
> > > > > page.
> > > > > > This page has an initialization method
> this is
> > > > > called
> > > > > > as follows.
> > > > > >
> > > > > > CWorkspace page = (CWorkspace)
> > > > > > cycle.getPage("CWorkspace");
> > > > > > page.setup((Container)item,null);
> > > > > >
> > > > > > So far, no problem.
> > > > > >
> > > > > > The user then performs a click with in one
> of
> > > these
> > > > > > components and the same page is called on
> this
> > > time
> > > > > > with a new object passed to the setup
> method.
> > > > > >
> > > > > > So far, no problem.
> > > > > >
> > > > > > Now, I back on the browser to the first
> page
> > > and
> > > > > when
> > > > > > I click on another link, the components
> are
> > > seeing
> > > > > the
> > > > > > data passed to them from the second page.
> It
> > > is as
> > > > > if
> > > > > > the page did not have its persistant
> variables
> > > reset
> > > > > > for page 1. They remain for page 2.
> > > > > >
> > > > > > What is causing this and how should I fix
> it.
> > > > > >
> > > > > > Thanks
> > > > > > E
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > >
> >
>
---------------------------------------------------------------------
> > > > > 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
> > > >
> 
=== message truncated ===




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


Re: Please expand on this

Posted by Jesse Kuhnert <jk...@gmail.com>.
Yes :) You should upgrade. 
On 8/17/05, Edward Scanzano <es...@yahoo.com> wrote:
> client-persistent page properties? What are they?
> 
> Is that a T4 feature?
> 
> E
> 
> --- Howard Lewis Ship <hl...@gmail.com> wrote:
> 
> > This kind of navigation context is ideal for
> > handling via
> > client-persistent page properties.
> >
> > On 8/17/05, Patrick Casey <pa...@adelphia.net>
> > wrote:
> > >
> > >         What I ended up doing was rolling my own
> > persist layer. The tapestry
> > > persist layer persists on the session/page level,
> > which falls apart if you
> > > have multiple instances of the same page up e.g.
> > >
> > >         List of Dogs
> > >         Right Click -> Open in new Window ->
> > Poodle
> > >         Right Click -> Open in new Window ->
> > Rotwilder
> > >         Click on poolde form.
> > >         Name it muffy.
> > >         Push save.
> > >
> > >         Congrats, your rotwilder is now named
> > muffy.
> > >
> > >         I ended up having to put a hidden keyfield
> > atop each and every one
> > > of my edit forms and then bootstrapping the form
> > back based on that key.
> > > Intitially I was just stuffing the ID value of
> > whatever was getting edited,
> > > but it turns out in practice you usually need to
> > persist more than that e.g.
> > > what page do I redirect to *after* a save? The
> > user expects to go back to
> > > the list, etc.
> > >
> > >         So what I do is generate a
> > "pesistencecontext" object for each form
> > > and then save it in a LRU cache in the session
> > (with a unique key). This key
> > > to this context goes out with each edit form on
> > *top* of the form so it
> > > rewinds first, and then I rebuild form state in
> > the setPersistKey()
> > > function.
> > >
> > >         Sort of awkward to describe, but once you
> > get it in place it works
> > > pretty well.
> > >
> > >         --- Pat
> > >
> > > > -----Original Message-----
> > > > From: Edward Scanzano
> > [mailto:escanzano@yahoo.com]
> > > > Sent: Wednesday, August 17, 2005 11:20 AM
> > > > To: tapestry-user; dario.vasconcelos@gmail.com
> > > > Subject: Please expand on this
> > > >
> > > > Hi All (and Dario),
> > > >
> > > > How am I supposed to access the value of a field
> > on
> > > > the form from within the java code if it is not
> > in a
> > > > form post?
> > > >
> > > > I find it hard to believe that when Tapestry
> > persists
> > > > the state of a page it does not attach it to an
> > > > instance of a page. This makes supporting
> > backing a
> > > > real pain and basically my responsibility.
> > > >
> > > > Do I have this right.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > This is expected behavior. If your parameters
> > are
> > > > persisted, then they
> > > > will have the last value they were set to,
> > regarding
> > > > of how many
> > > > "backs" you perform.
> > > >
> > > > You need to use Hidden fields to avoid this.
> > > >
> > > >
> > > > On 8/10/05, Edward Scanzano
> > <es...@yahoo.com>
> > > > wrote:
> > > > > Hi all,
> > > > >
> > > > > I have a page when have a number of components
> > that
> > > > > are passed parameters which are persisted in
> > the
> > > > page.
> > > > > This page has an initialization method this is
> > > > called
> > > > > as follows.
> > > > >
> > > > > CWorkspace page = (CWorkspace)
> > > > > cycle.getPage("CWorkspace");
> > > > > page.setup((Container)item,null);
> > > > >
> > > > > So far, no problem.
> > > > >
> > > > > The user then performs a click with in one of
> > these
> > > > > components and the same page is called on this
> > time
> > > > > with a new object passed to the setup method.
> > > > >
> > > > > So far, no problem.
> > > > >
> > > > > Now, I back on the browser to the first page
> > and
> > > > when
> > > > > I click on another link, the components are
> > seeing
> > > > the
> > > > > data passed to them from the second page. It
> > is as
> > > > if
> > > > > the page did not have its persistant variables
> > reset
> > > > > for page 1. They remain for page 2.
> > > > >
> > > > > What is causing this and how should I fix it.
> > > > >
> > > > > Thanks
> > > > > E
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> >
> ---------------------------------------------------------------------
> > > > 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
> >
> >
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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: Please expand on this

Posted by Edward Scanzano <es...@yahoo.com>.
client-persistent page properties? What are they?

Is that a T4 feature?

E

--- Howard Lewis Ship <hl...@gmail.com> wrote:

> This kind of navigation context is ideal for
> handling via
> client-persistent page properties.
> 
> On 8/17/05, Patrick Casey <pa...@adelphia.net>
> wrote:
> > 
> >         What I ended up doing was rolling my own
> persist layer. The tapestry
> > persist layer persists on the session/page level,
> which falls apart if you
> > have multiple instances of the same page up e.g.
> > 
> >         List of Dogs
> >         Right Click -> Open in new Window ->
> Poodle
> >         Right Click -> Open in new Window ->
> Rotwilder
> >         Click on poolde form.
> >         Name it muffy.
> >         Push save.
> > 
> >         Congrats, your rotwilder is now named
> muffy.
> > 
> >         I ended up having to put a hidden keyfield
> atop each and every one
> > of my edit forms and then bootstrapping the form
> back based on that key.
> > Intitially I was just stuffing the ID value of
> whatever was getting edited,
> > but it turns out in practice you usually need to
> persist more than that e.g.
> > what page do I redirect to *after* a save? The
> user expects to go back to
> > the list, etc.
> > 
> >         So what I do is generate a
> "pesistencecontext" object for each form
> > and then save it in a LRU cache in the session
> (with a unique key). This key
> > to this context goes out with each edit form on
> *top* of the form so it
> > rewinds first, and then I rebuild form state in
> the setPersistKey()
> > function.
> > 
> >         Sort of awkward to describe, but once you
> get it in place it works
> > pretty well.
> > 
> >         --- Pat
> > 
> > > -----Original Message-----
> > > From: Edward Scanzano
> [mailto:escanzano@yahoo.com]
> > > Sent: Wednesday, August 17, 2005 11:20 AM
> > > To: tapestry-user; dario.vasconcelos@gmail.com
> > > Subject: Please expand on this
> > >
> > > Hi All (and Dario),
> > >
> > > How am I supposed to access the value of a field
> on
> > > the form from within the java code if it is not
> in a
> > > form post?
> > >
> > > I find it hard to believe that when Tapestry
> persists
> > > the state of a page it does not attach it to an
> > > instance of a page. This makes supporting
> backing a
> > > real pain and basically my responsibility.
> > >
> > > Do I have this right.
> > >
> > >
> > >
> > >
> > >
> > > This is expected behavior. If your parameters
> are
> > > persisted, then they
> > > will have the last value they were set to,
> regarding
> > > of how many
> > > "backs" you perform.
> > >
> > > You need to use Hidden fields to avoid this.
> > >
> > >
> > > On 8/10/05, Edward Scanzano
> <es...@yahoo.com>
> > > wrote:
> > > > Hi all,
> > > >
> > > > I have a page when have a number of components
> that
> > > > are passed parameters which are persisted in
> the
> > > page.
> > > > This page has an initialization method this is
> > > called
> > > > as follows.
> > > >
> > > > CWorkspace page = (CWorkspace)
> > > > cycle.getPage("CWorkspace");
> > > > page.setup((Container)item,null);
> > > >
> > > > So far, no problem.
> > > >
> > > > The user then performs a click with in one of
> these
> > > > components and the same page is called on this
> time
> > > > with a new object passed to the setup method.
> > > >
> > > > So far, no problem.
> > > >
> > > > Now, I back on the browser to the first page
> and
> > > when
> > > > I click on another link, the components are
> seeing
> > > the
> > > > data passed to them from the second page. It
> is as
> > > if
> > > > the page did not have its persistant variables
> reset
> > > > for page 1. They remain for page 2.
> > > >
> > > > What is causing this and how should I fix it.
> > > >
> > > > Thanks
> > > > E
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
>
---------------------------------------------------------------------
> > > 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
> 
> 




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


RE: Please expand on this

Posted by Patrick Casey <pa...@adelphia.net>.
	That's a new 4.0ism though isn't it Howard? I don't seem to recall
any OOB client persistence strategies with 3.0.3 (although maybe my memory
is just totally narfed).

	--- Pat

> -----Original Message-----
> From: Howard Lewis Ship [mailto:hlship@gmail.com]
> Sent: Wednesday, August 17, 2005 12:14 PM
> To: Tapestry users
> Subject: Re: Please expand on this
> 
> This kind of navigation context is ideal for handling via
> client-persistent page properties.
> 
> On 8/17/05, Patrick Casey <pa...@adelphia.net> wrote:
> >
> >         What I ended up doing was rolling my own persist layer. The
> tapestry
> > persist layer persists on the session/page level, which falls apart if
> you
> > have multiple instances of the same page up e.g.
> >
> >         List of Dogs
> >         Right Click -> Open in new Window -> Poodle
> >         Right Click -> Open in new Window -> Rotwilder
> >         Click on poolde form.
> >         Name it muffy.
> >         Push save.
> >
> >         Congrats, your rotwilder is now named muffy.
> >
> >         I ended up having to put a hidden keyfield atop each and every
> one
> > of my edit forms and then bootstrapping the form back based on that key.
> > Intitially I was just stuffing the ID value of whatever was getting
> edited,
> > but it turns out in practice you usually need to persist more than that
> e.g.
> > what page do I redirect to *after* a save? The user expects to go back
> to
> > the list, etc.
> >
> >         So what I do is generate a "pesistencecontext" object for each
> form
> > and then save it in a LRU cache in the session (with a unique key). This
> key
> > to this context goes out with each edit form on *top* of the form so it
> > rewinds first, and then I rebuild form state in the setPersistKey()
> > function.
> >
> >         Sort of awkward to describe, but once you get it in place it
> works
> > pretty well.
> >
> >         --- Pat
> >
> > > -----Original Message-----
> > > From: Edward Scanzano [mailto:escanzano@yahoo.com]
> > > Sent: Wednesday, August 17, 2005 11:20 AM
> > > To: tapestry-user; dario.vasconcelos@gmail.com
> > > Subject: Please expand on this
> > >
> > > Hi All (and Dario),
> > >
> > > How am I supposed to access the value of a field on
> > > the form from within the java code if it is not in a
> > > form post?
> > >
> > > I find it hard to believe that when Tapestry persists
> > > the state of a page it does not attach it to an
> > > instance of a page. This makes supporting backing a
> > > real pain and basically my responsibility.
> > >
> > > Do I have this right.
> > >
> > >
> > >
> > >
> > >
> > > This is expected behavior. If your parameters are
> > > persisted, then they
> > > will have the last value they were set to, regarding
> > > of how many
> > > "backs" you perform.
> > >
> > > You need to use Hidden fields to avoid this.
> > >
> > >
> > > On 8/10/05, Edward Scanzano <es...@yahoo.com>
> > > wrote:
> > > > Hi all,
> > > >
> > > > I have a page when have a number of components that
> > > > are passed parameters which are persisted in the
> > > page.
> > > > This page has an initialization method this is
> > > called
> > > > as follows.
> > > >
> > > > CWorkspace page = (CWorkspace)
> > > > cycle.getPage("CWorkspace");
> > > > page.setup((Container)item,null);
> > > >
> > > > So far, no problem.
> > > >
> > > > The user then performs a click with in one of these
> > > > components and the same page is called on this time
> > > > with a new object passed to the setup method.
> > > >
> > > > So far, no problem.
> > > >
> > > > Now, I back on the browser to the first page and
> > > when
> > > > I click on another link, the components are seeing
> > > the
> > > > data passed to them from the second page. It is as
> > > if
> > > > the page did not have its persistant variables reset
> > > > for page 1. They remain for page 2.
> > > >
> > > > What is causing this and how should I fix it.
> > > >
> > > > Thanks
> > > > E
> > > >
> > > >
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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




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


Re: Please expand on this

Posted by Howard Lewis Ship <hl...@gmail.com>.
This kind of navigation context is ideal for handling via
client-persistent page properties.

On 8/17/05, Patrick Casey <pa...@adelphia.net> wrote:
> 
>         What I ended up doing was rolling my own persist layer. The tapestry
> persist layer persists on the session/page level, which falls apart if you
> have multiple instances of the same page up e.g.
> 
>         List of Dogs
>         Right Click -> Open in new Window -> Poodle
>         Right Click -> Open in new Window -> Rotwilder
>         Click on poolde form.
>         Name it muffy.
>         Push save.
> 
>         Congrats, your rotwilder is now named muffy.
> 
>         I ended up having to put a hidden keyfield atop each and every one
> of my edit forms and then bootstrapping the form back based on that key.
> Intitially I was just stuffing the ID value of whatever was getting edited,
> but it turns out in practice you usually need to persist more than that e.g.
> what page do I redirect to *after* a save? The user expects to go back to
> the list, etc.
> 
>         So what I do is generate a "pesistencecontext" object for each form
> and then save it in a LRU cache in the session (with a unique key). This key
> to this context goes out with each edit form on *top* of the form so it
> rewinds first, and then I rebuild form state in the setPersistKey()
> function.
> 
>         Sort of awkward to describe, but once you get it in place it works
> pretty well.
> 
>         --- Pat
> 
> > -----Original Message-----
> > From: Edward Scanzano [mailto:escanzano@yahoo.com]
> > Sent: Wednesday, August 17, 2005 11:20 AM
> > To: tapestry-user; dario.vasconcelos@gmail.com
> > Subject: Please expand on this
> >
> > Hi All (and Dario),
> >
> > How am I supposed to access the value of a field on
> > the form from within the java code if it is not in a
> > form post?
> >
> > I find it hard to believe that when Tapestry persists
> > the state of a page it does not attach it to an
> > instance of a page. This makes supporting backing a
> > real pain and basically my responsibility.
> >
> > Do I have this right.
> >
> >
> >
> >
> >
> > This is expected behavior. If your parameters are
> > persisted, then they
> > will have the last value they were set to, regarding
> > of how many
> > "backs" you perform.
> >
> > You need to use Hidden fields to avoid this.
> >
> >
> > On 8/10/05, Edward Scanzano <es...@yahoo.com>
> > wrote:
> > > Hi all,
> > >
> > > I have a page when have a number of components that
> > > are passed parameters which are persisted in the
> > page.
> > > This page has an initialization method this is
> > called
> > > as follows.
> > >
> > > CWorkspace page = (CWorkspace)
> > > cycle.getPage("CWorkspace");
> > > page.setup((Container)item,null);
> > >
> > > So far, no problem.
> > >
> > > The user then performs a click with in one of these
> > > components and the same page is called on this time
> > > with a new object passed to the setup method.
> > >
> > > So far, no problem.
> > >
> > > Now, I back on the browser to the first page and
> > when
> > > I click on another link, the components are seeing
> > the
> > > data passed to them from the second page. It is as
> > if
> > > the page did not have its persistant variables reset
> > > for page 1. They remain for page 2.
> > >
> > > What is causing this and how should I fix it.
> > >
> > > Thanks
> > > E
> > >
> > >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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: Please expand on this

Posted by Patrick Casey <pa...@adelphia.net>.
	Well, if there are no forms on the page, but you need to persist it,
I usually just stick the persistKey as an argument to any directlinks on the
form. Then when the directlink invokes, I bootstrap persistence.

	As for changing it, I dunno, you'll have to ask Howard. It's a big
problem for me (and apparently you), but I'm hesistant to claim that it's a
universal issue for other users without some more feedback. It's possible
that for what most people (most especially including Howard) are doing with
Tapestry, the OOB persistence model works fine.


	--- Pat

> -----Original Message-----
> From: Edward Scanzano [mailto:escanzano@yahoo.com]
> Sent: Wednesday, August 17, 2005 11:50 AM
> To: Tapestry users
> Subject: RE: Please expand on this
> 
> Thanks Patrick for that info.
> 
> How does this work if there are no forms on a page?
> 
> Will Tapestry ever change this behavior. This seems
> like a really important feature to support in the
> framework. I know HLS was influenced by WebObjects and
>  I know it does support this bahavior.
> 
> Thanks
> E
> 
> --- Patrick Casey <pa...@adelphia.net> wrote:
> 
> >
> > 	What I ended up doing was rolling my own persist
> > layer. The tapestry
> > persist layer persists on the session/page level,
> > which falls apart if you
> > have multiple instances of the same page up e.g.
> >
> > 	List of Dogs
> > 	Right Click -> Open in new Window -> Poodle
> > 	Right Click -> Open in new Window -> Rotwilder
> > 	Click on poolde form.
> > 	Name it muffy.
> > 	Push save.
> >
> > 	Congrats, your rotwilder is now named muffy.
> >
> > 	I ended up having to put a hidden keyfield atop
> > each and every one
> > of my edit forms and then bootstrapping the form
> > back based on that key.
> > Intitially I was just stuffing the ID value of
> > whatever was getting edited,
> > but it turns out in practice you usually need to
> > persist more than that e.g.
> > what page do I redirect to *after* a save? The user
> > expects to go back to
> > the list, etc.
> >
> > 	So what I do is generate a "pesistencecontext"
> > object for each form
> > and then save it in a LRU cache in the session (with
> > a unique key). This key
> > to this context goes out with each edit form on
> > *top* of the form so it
> > rewinds first, and then I rebuild form state in the
> > setPersistKey()
> > function.
> >
> > 	Sort of awkward to describe, but once you get it in
> > place it works
> > pretty well.
> >
> > 	--- Pat
> >
> > > -----Original Message-----
> > > From: Edward Scanzano [mailto:escanzano@yahoo.com]
> > > Sent: Wednesday, August 17, 2005 11:20 AM
> > > To: tapestry-user; dario.vasconcelos@gmail.com
> > > Subject: Please expand on this
> > >
> > > Hi All (and Dario),
> > >
> > > How am I supposed to access the value of a field
> > on
> > > the form from within the java code if it is not in
> > a
> > > form post?
> > >
> > > I find it hard to believe that when Tapestry
> > persists
> > > the state of a page it does not attach it to an
> > > instance of a page. This makes supporting backing
> > a
> > > real pain and basically my responsibility.
> > >
> > > Do I have this right.
> > >
> > >
> > >
> > >
> > >
> > > This is expected behavior. If your parameters are
> > > persisted, then they
> > > will have the last value they were set to,
> > regarding
> > > of how many
> > > "backs" you perform.
> > >
> > > You need to use Hidden fields to avoid this.
> > >
> > >
> > > On 8/10/05, Edward Scanzano <es...@yahoo.com>
> > > wrote:
> > > > Hi all,
> > > >
> > > > I have a page when have a number of components
> > that
> > > > are passed parameters which are persisted in the
> > > page.
> > > > This page has an initialization method this is
> > > called
> > > > as follows.
> > > >
> > > > CWorkspace page = (CWorkspace)
> > > > cycle.getPage("CWorkspace");
> > > > page.setup((Container)item,null);
> > > >
> > > > So far, no problem.
> > > >
> > > > The user then performs a click with in one of
> > these
> > > > components and the same page is called on this
> > time
> > > > with a new object passed to the setup method.
> > > >
> > > > So far, no problem.
> > > >
> > > > Now, I back on the browser to the first page and
> > > when
> > > > I click on another link, the components are
> > seeing
> > > the
> > > > data passed to them from the second page. It is
> > as
> > > if
> > > > the page did not have its persistant variables
> > reset
> > > > for page 1. They remain for page 2.
> > > >
> > > > What is causing this and how should I fix it.
> > > >
> > > > Thanks
> > > > E
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > 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




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


RE: Please expand on this

Posted by Edward Scanzano <es...@yahoo.com>.
Thanks Patrick for that info.

How does this work if there are no forms on a page?

Will Tapestry ever change this behavior. This seems
like a really important feature to support in the
framework. I know HLS was influenced by WebObjects and
 I know it does support this bahavior.

Thanks
E

--- Patrick Casey <pa...@adelphia.net> wrote:

> 
> 	What I ended up doing was rolling my own persist
> layer. The tapestry
> persist layer persists on the session/page level,
> which falls apart if you
> have multiple instances of the same page up e.g.
> 
> 	List of Dogs
> 	Right Click -> Open in new Window -> Poodle
> 	Right Click -> Open in new Window -> Rotwilder
> 	Click on poolde form.
> 	Name it muffy.
> 	Push save.
> 
> 	Congrats, your rotwilder is now named muffy.
> 
> 	I ended up having to put a hidden keyfield atop
> each and every one
> of my edit forms and then bootstrapping the form
> back based on that key.
> Intitially I was just stuffing the ID value of
> whatever was getting edited,
> but it turns out in practice you usually need to
> persist more than that e.g.
> what page do I redirect to *after* a save? The user
> expects to go back to
> the list, etc.
> 
> 	So what I do is generate a "pesistencecontext"
> object for each form
> and then save it in a LRU cache in the session (with
> a unique key). This key
> to this context goes out with each edit form on
> *top* of the form so it
> rewinds first, and then I rebuild form state in the
> setPersistKey()
> function.
> 
> 	Sort of awkward to describe, but once you get it in
> place it works
> pretty well.
> 
> 	--- Pat
> 
> > -----Original Message-----
> > From: Edward Scanzano [mailto:escanzano@yahoo.com]
> > Sent: Wednesday, August 17, 2005 11:20 AM
> > To: tapestry-user; dario.vasconcelos@gmail.com
> > Subject: Please expand on this
> > 
> > Hi All (and Dario),
> > 
> > How am I supposed to access the value of a field
> on
> > the form from within the java code if it is not in
> a
> > form post?
> > 
> > I find it hard to believe that when Tapestry
> persists
> > the state of a page it does not attach it to an
> > instance of a page. This makes supporting backing
> a
> > real pain and basically my responsibility.
> > 
> > Do I have this right.
> > 
> > 
> > 
> > 
> > 
> > This is expected behavior. If your parameters are
> > persisted, then they
> > will have the last value they were set to,
> regarding
> > of how many
> > "backs" you perform.
> > 
> > You need to use Hidden fields to avoid this.
> > 
> > 
> > On 8/10/05, Edward Scanzano <es...@yahoo.com>
> > wrote:
> > > Hi all,
> > >
> > > I have a page when have a number of components
> that
> > > are passed parameters which are persisted in the
> > page.
> > > This page has an initialization method this is
> > called
> > > as follows.
> > >
> > > CWorkspace page = (CWorkspace)
> > > cycle.getPage("CWorkspace");
> > > page.setup((Container)item,null);
> > >
> > > So far, no problem.
> > >
> > > The user then performs a click with in one of
> these
> > > components and the same page is called on this
> time
> > > with a new object passed to the setup method.
> > >
> > > So far, no problem.
> > >
> > > Now, I back on the browser to the first page and
> > when
> > > I click on another link, the components are
> seeing
> > the
> > > data passed to them from the second page. It is
> as
> > if
> > > the page did not have its persistant variables
> reset
> > > for page 1. They remain for page 2.
> > >
> > > What is causing this and how should I fix it.
> > >
> > > Thanks
> > > E
> > >
> > >
> > 
> > 
> > 
> > 
> >
>
---------------------------------------------------------------------
> > 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: Please expand on this

Posted by Patrick Casey <pa...@adelphia.net>.
	What I ended up doing was rolling my own persist layer. The tapestry
persist layer persists on the session/page level, which falls apart if you
have multiple instances of the same page up e.g.

	List of Dogs
	Right Click -> Open in new Window -> Poodle
	Right Click -> Open in new Window -> Rotwilder
	Click on poolde form.
	Name it muffy.
	Push save.

	Congrats, your rotwilder is now named muffy.

	I ended up having to put a hidden keyfield atop each and every one
of my edit forms and then bootstrapping the form back based on that key.
Intitially I was just stuffing the ID value of whatever was getting edited,
but it turns out in practice you usually need to persist more than that e.g.
what page do I redirect to *after* a save? The user expects to go back to
the list, etc.

	So what I do is generate a "pesistencecontext" object for each form
and then save it in a LRU cache in the session (with a unique key). This key
to this context goes out with each edit form on *top* of the form so it
rewinds first, and then I rebuild form state in the setPersistKey()
function.

	Sort of awkward to describe, but once you get it in place it works
pretty well.

	--- Pat

> -----Original Message-----
> From: Edward Scanzano [mailto:escanzano@yahoo.com]
> Sent: Wednesday, August 17, 2005 11:20 AM
> To: tapestry-user; dario.vasconcelos@gmail.com
> Subject: Please expand on this
> 
> Hi All (and Dario),
> 
> How am I supposed to access the value of a field on
> the form from within the java code if it is not in a
> form post?
> 
> I find it hard to believe that when Tapestry persists
> the state of a page it does not attach it to an
> instance of a page. This makes supporting backing a
> real pain and basically my responsibility.
> 
> Do I have this right.
> 
> 
> 
> 
> 
> This is expected behavior. If your parameters are
> persisted, then they
> will have the last value they were set to, regarding
> of how many
> "backs" you perform.
> 
> You need to use Hidden fields to avoid this.
> 
> 
> On 8/10/05, Edward Scanzano <es...@yahoo.com>
> wrote:
> > Hi all,
> >
> > I have a page when have a number of components that
> > are passed parameters which are persisted in the
> page.
> > This page has an initialization method this is
> called
> > as follows.
> >
> > CWorkspace page = (CWorkspace)
> > cycle.getPage("CWorkspace");
> > page.setup((Container)item,null);
> >
> > So far, no problem.
> >
> > The user then performs a click with in one of these
> > components and the same page is called on this time
> > with a new object passed to the setup method.
> >
> > So far, no problem.
> >
> > Now, I back on the browser to the first page and
> when
> > I click on another link, the components are seeing
> the
> > data passed to them from the second page. It is as
> if
> > the page did not have its persistant variables reset
> > for page 1. They remain for page 2.
> >
> > What is causing this and how should I fix it.
> >
> > Thanks
> > E
> >
> >
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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