Re: Best practice for initializing page to default context

2009-12-09 Thread Kalle Korhonen
Opened https://issues.apache.org/jira/browse/TAP5-948 for it. Kalle On Tue, Dec 8, 2009 at 11:24 AM, Kalle Korhonen wrote: > On Tue, Dec 8, 2009 at 10:59 AM, Howard Lewis Ship wrote: >> I've had to solve this problem for one of my clients as well and I >> think it's something that should go int

Re: Best practice for initializing page to default context

2009-12-08 Thread Kalle Korhonen
Yes, I agree with that Norman. That's sort of what I implied when I said that I "always link to pages with initial context already set" - i.e. the reverse works better - re-initialize the page if a specific context is set. That's one way, what Howard suggests is another (identify page internal link

Re: Best practice for initializing page to default context

2009-12-08 Thread Norman Franke
I implemented a somewhat similar approach for search using an even more basic approach. Most of my search fields are @Persisted, but I still needed a way to know when to reset the search dialog. I ended up creating a new context parameter, consisting of the string "reset". Every time I want

Re: Best practice for initializing page to default context

2009-12-08 Thread Kalle Korhonen
On Tue, Dec 8, 2009 at 10:59 AM, Howard Lewis Ship wrote: > I've had to solve this problem for one of my clients as well and I > think it's something that should go into the framework.  The approach > I took was to identify self-referential links (page render links that > are to the same page they

Re: Best practice for initializing page to default context

2009-12-08 Thread Howard Lewis Ship
I've had to solve this problem for one of my clients as well and I think it's something that should go into the framework. The approach I took was to identify self-referential links (page render links that are to the same page they originate from) using an additional query parameter. This allows T

Re: Best practice for initializing page to default context

2009-12-08 Thread Thiago H. de Paula Figueiredo
Em Tue, 08 Dec 2009 16:23:37 -0200, ningdh escreveu: Hi, Thiago Hi! What Kalle and I concern is the onActivate must come first before onPassivate, so if page A links to page B, A must set the context of B first, right? In this case, onActivate() is not invoked, so A must invoke one or

Re: Best practice for initializing page to default context

2009-12-08 Thread ningdh
Hi, Thiago - Original Message - From: "Thiago H. de Paula Figueiredo" To: "Tapestry users" Sent: Wednesday, December 09, 2009 2:09 AM Subject: Re: Best practice for initializing page to default context > Em Tue, 08 Dec 2009 15:49:15 -0200, Kalle Korhonen

Re: Best practice for initializing page to default context

2009-12-08 Thread Kalle Korhonen
;Kalle Korhonen" > To: "Tapestry users" > Sent: Wednesday, December 09, 2009 1:49 AM > Subject: Re: Best practice for initializing page to default context > > >> On Tue, Dec 8, 2009 at 3:39 AM, Thiago H. de Paula Figueiredo >> wrote: >>> Em Tue, 08 Dec 2

Re: Best practice for initializing page to default context

2009-12-08 Thread Thiago H. de Paula Figueiredo
Em Tue, 08 Dec 2009 15:49:15 -0200, Kalle Korhonen escreveu: DH's approach looks interesting, but maybe a bit involving with field names encoded to the url. Thiago, I know it's the recommended approach but I'm just saying it doesn't strike me as the ideal approach. The ideal solution always

Re: Best practice for initializing page to default context

2009-12-08 Thread ningdh
rchpage/cat-VALUE I like this style a lot and use heavily in my multiple projects. DH - Original Message - From: "Kalle Korhonen" To: "Tapestry users" Sent: Wednesday, December 09, 2009 1:49 AM Subject: Re: Best practice for initializing page to default context &g

Re: Best practice for initializing page to default context

2009-12-08 Thread Kalle Korhonen
On Tue, Dec 8, 2009 at 3:39 AM, Thiago H. de Paula Figueiredo wrote: > Em Tue, 08 Dec 2009 04:22:58 -0200, Kalle Korhonen > escreveu: >> and subsequently, if my page has multiple entry points, I typically >> resort to implementing it in a single onActivate(EventContext >> eventContext) operation

Re: Best practice for initializing page to default context

2009-12-08 Thread NingDH
rcer typeCoercer) { configuration.add("PageActivationUnit", new PageActivationUnitWorker(typeCoercer), "before:OnEvent"); } That's all. One disadvantage is that you can't use primitive type for param field, so use Integer instead of int. DH http://www.gaonline.com.cn

Re: Best practice for initializing page to default context

2009-12-08 Thread Thiago H. de Paula Figueiredo
Em Tue, 08 Dec 2009 04:22:58 -0200, Kalle Korhonen escreveu: and subsequently, if my page has multiple entry points, I typically resort to implementing it in a single onActivate(EventContext eventContext) operation containing a big if-else clause. That's the recommended way when you have a

Re: Best practice for initializing page to default context

2009-12-08 Thread DH
rcer typeCoercer) { configuration.add("PageActivationUnit", new PageActivationUnitWorker(typeCoercer), "before:OnEvent"); } That's all. One disadvantage is that you can't use primitive type for param field, so use Integer instead of int. DH http://www.gaonline.com.cn

Re: Best practice for initializing page to default context

2009-12-08 Thread Inge Solvoll
Would it be possible for you to share that code with us? I don't necessarily want to use that approach, but it would be very helpful to see how you implemented it. Inge On Tue, Dec 8, 2009 at 9:10 AM, DH wrote: > Once I found it difficult too, and I never used EventContext because I > think it

Re: Best practice for initializing page to default context

2009-12-08 Thread DH
Once I found it difficult too, and I never used EventContext because I think it is not better than multiple onActivate. Finally I wrote my own PageActivationContext called PageActivationUnit, the difference is that PageActivationContext only can occur once, but PageActivationUnit can be used i