You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Algirdas <al...@gmail.com> on 2008/07/30 22:01:13 UTC

URL parameters or context?

I'm writing custom grid component with paging, sorting, etc.
(also migrating from Tapestry 4.0.2 to T5).

I need to pass page number, page size, sorting order and so on in url. 
There is this new "context" thing and wonder if I should use it.

That is, my old implementation was 
myapp/product?id=10&pnum=2&psize=5

with context I could do
myapp/product/10/pnum/2/psize/5

Any suggestions on which implementation I should choose?

In both cases I would generate links manually.

I would rather go with the first one, but passing "psize=5" to context of
PageLink
encodes into "psize%3D5". Any thoughts about this?

-- 
View this message in context: http://n2.nabble.com/URL-parameters-or-context--tp661050p661050.html
Sent from the Tapestry Users mailing list archive at Nabble.com.


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


Re: URL parameters or context?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Thu, 31 Jul 2008 09:00:24 -0300, Algirdas <al...@gmail.com>  
escreveu:

> And how should I  use parameters? In older application (4.0.2) I had
> components that have parameters
> of text/id and they render appropriate PageLink. Now, with the same
> approach, passing all parameters as string from code to PageLink's  
> context,
> as I said earlier, codes "psize=5" to "psize%3D5" (or did I messed up
> something..)

Tapestry 5 links are built on the activation context concept. So, if you  
want to use "normal" (key=value) parameters, you are on your own. If you  
want to work with parameters, you can't use ActionLink nor PageLink,  
you'll have to write all the code yourself.

And why don't you use the wonderful Grid component? It has all the  
features you want and, in addition, you have out-of-the-box AJAX suport.

Thiago

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


Re: URL parameters or context?

Posted by Algirdas <al...@gmail.com>.
Thank you for an opinion :)

What do you mean by RESTFull?

And how should I  use parameters? In older application (4.0.2) I had
components that have parameters
of text/id and they render appropriate PageLink. Now, with the same
approach, passing all parameters as string from code to PageLink's context,
as I said earlier, codes "psize=5" to "psize%3D5" (or did I messed up
something..)

Maybe somehow I could use Link/LinkImpl (which have addParameter method)? I
found some posts with them, but I'm not sure how to use them in my situation
(that is, not returning Link object on some action, but rather rendering a
valid link in html).

Algirdas


Renat Zubairov wrote:
> 
> IMHO passing page number as page activation context is not RESTFull :)
> depends on the use cases off course.
> I think you would better use parameter for that.
> 
> Renat
> 
> 2008/7/30 Algirdas <al...@gmail.com>:
>>
>> I'm writing custom grid component with paging, sorting, etc.
>> (also migrating from Tapestry 4.0.2 to T5).
>>
>> I need to pass page number, page size, sorting order and so on in url.
>> There is this new "context" thing and wonder if I should use it.
>>
>> That is, my old implementation was
>> myapp/product?id=10&pnum=2&psize=5
>>
>> with context I could do
>> myapp/product/10/pnum/2/psize/5
>>
>> Any suggestions on which implementation I should choose?
>>
>> In both cases I would generate links manually.
>>
>> I would rather go with the first one, but passing "psize=5" to context of
>> PageLink
>> encodes into "psize%3D5". Any thoughts about this?
>>
>> --
>> View this message in context:
>> http://n2.nabble.com/URL-parameters-or-context--tp661050p661050.html
>> Sent from the Tapestry Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 
> 
> -- 
> Best regards,
> Renat Zubairov
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://n2.nabble.com/URL-parameters-or-context--tp661050p662204.html
Sent from the Tapestry Users mailing list archive at Nabble.com.


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


Re: URL parameters or context?

Posted by Renat Zubairov <re...@gmail.com>.
IMHO passing page number as page activation context is not RESTFull :)
depends on the use cases off course.
I think you would better use parameter for that.

Renat

2008/7/30 Algirdas <al...@gmail.com>:
>
> I'm writing custom grid component with paging, sorting, etc.
> (also migrating from Tapestry 4.0.2 to T5).
>
> I need to pass page number, page size, sorting order and so on in url.
> There is this new "context" thing and wonder if I should use it.
>
> That is, my old implementation was
> myapp/product?id=10&pnum=2&psize=5
>
> with context I could do
> myapp/product/10/pnum/2/psize/5
>
> Any suggestions on which implementation I should choose?
>
> In both cases I would generate links manually.
>
> I would rather go with the first one, but passing "psize=5" to context of
> PageLink
> encodes into "psize%3D5". Any thoughts about this?
>
> --
> View this message in context: http://n2.nabble.com/URL-parameters-or-context--tp661050p661050.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Best regards,
Renat Zubairov

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