You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Joel Halbert <jo...@su3analytics.com> on 2010/06/18 17:30:48 UTC
Page Navigation - Link vs Page when appending a query string to the
result
I want to return the user to a page that has a context and some query
params:
I can do this, using Link:
public Object onSubmit(){
Link link = ls.createPageRenderLinkWithContext(Buy.class, product);
link.addParameter("x", x);
link.addParameter("y", y);
return link;
}
Directs the user to;
http://localhost:8080/web/buy/product?x=1&y=2
I want to know if I can easily do the same using Page:
@InjectPage
private Buy buy;
public Object onSubmit() {
buy.setProduct(product)
return buy;
}
And in Buy have an onPassivate to get the correct context
Buy {
String onPassivate90{return product}
}
Whch gets me the URL:
http://localhost:8080/web/buy/product
But what's the easiest way of then tacking on the query string I want?
Re: Page Navigation - Link vs Page when appending a query string
to the result
Posted by Joel Halbert <jo...@su3analytics.com>.
Thanks, I was curious as to whether I could do what I need using Page,
but in the meantime can get around it using Link.
On 18/06/10 18:02, Howard Lewis Ship wrote:
> Currently, there isn't a good way to do what you want. I just hit a
> similar problem for my client and am deciding on the right solution; I
> think another callback event, much like passivate, but passed the Link
> so it can be customized.
>
> See https://issues.apache.org/jira/browse/TAP5-1190
>
> On Fri, Jun 18, 2010 at 8:30 AM, Joel Halbert<jo...@su3analytics.com> wrote:
>
>> I want to return the user to a page that has a context and some query
>> params:
>>
>> I can do this, using Link:
>>
>> public Object onSubmit(){
>> Link link = ls.createPageRenderLinkWithContext(Buy.class, product);
>> link.addParameter("x", x);
>> link.addParameter("y", y);
>> return link;
>> }
>>
>> Directs the user to;
>> http://localhost:8080/web/buy/product?x=1&y=2
>>
>> I want to know if I can easily do the same using Page:
>>
>> @InjectPage
>> private Buy buy;
>> public Object onSubmit() {
>> buy.setProduct(product)
>> return buy;
>> }
>>
>> And in Buy have an onPassivate to get the correct context
>> Buy {
>> String onPassivate90{return product}
>> }
>>
>> Whch gets me the URL:
>> http://localhost:8080/web/buy/product
>>
>> But what's the easiest way of then tacking on the query string I want?
>>
>>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Page Navigation - Link vs Page when appending a query string to
the result
Posted by Howard Lewis Ship <hl...@gmail.com>.
Currently, there isn't a good way to do what you want. I just hit a
similar problem for my client and am deciding on the right solution; I
think another callback event, much like passivate, but passed the Link
so it can be customized.
See https://issues.apache.org/jira/browse/TAP5-1190
On Fri, Jun 18, 2010 at 8:30 AM, Joel Halbert <jo...@su3analytics.com> wrote:
> I want to return the user to a page that has a context and some query
> params:
>
> I can do this, using Link:
>
> public Object onSubmit(){
> Link link = ls.createPageRenderLinkWithContext(Buy.class, product);
> link.addParameter("x", x);
> link.addParameter("y", y);
> return link;
> }
>
> Directs the user to;
> http://localhost:8080/web/buy/product?x=1&y=2
>
> I want to know if I can easily do the same using Page:
>
> @InjectPage
> private Buy buy;
> public Object onSubmit() {
> buy.setProduct(product)
> return buy;
> }
>
> And in Buy have an onPassivate to get the correct context
> Buy {
> String onPassivate90{return product}
> }
>
> Whch gets me the URL:
> http://localhost:8080/web/buy/product
>
> But what's the easiest way of then tacking on the query string I want?
>
--
Howard M. Lewis Ship
Creator of Apache Tapestry
The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!
(971) 678-5210
http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org