Hi Ivan,
I'm trying out your extension, thanks, one question though:
The following class seems to be missing from the zip you linked to below
(http://wfrag.org/files/tapext.zip):
ru.nsc.ict.catalogue.annotations.QueryParameter
can i get it anywhere?
Thx
Joel
Ivan Dubrov wrote:
Joel Halbert wrote:
Hi,
Is it possible to have "named" page context parameters? (along the
lines of Wicket PageParameters).
I would like to be able to have bookmarkable URLs but rather than
indexing page context parameters (in onActivate) by ordinal in a list
I would rather key them by name.
You can use Link#addParameter to add named parameters to Link and
Request#getParameter to get parameter value. This is simple way, but
requires some extra coding.
I’ve wrote my simple extension to Tapestry that allows to work with
named parameters the same way as with regular context parameters. You
can either implement your event handlers
(onStoreParameters/onRestoreParameters, their meaning is similar to
onPassivate/onActivate) or use @QueryParameter annotatiton.
Code: http://wfrag.org/files/tapext.zip
You can use it the following way (snippet from page class):
@QueryParameter
private Integer page;
The @QueryParameter works the similar way to @PageActivationContext
annotation
Since createPageLink/createEventLink and t:pagelink/t:eventlink does not
support overriding named parameters, to generate a link with “page”
value other than current one, you can use the following workaround:
// We temporarily set page to current one, to generate proper link,
// since we don't have a way to override parameter values
int saved = page;
page = newpage;
Link link = resources.createPageLink(resources.getPageName(), false);
page = saved;
Also, the code does not work well for primitive types (like “int”), so
it’s better to use wrappers.
--
SU3 Analytics Ltd
61b Oxford Gardens
W10 5UJ
London
Tel: +44 20 8960 2634
Mob: +44 75 2501 0825
www.su3analytics.com
SU3 Analytics Ltd is a company registered in England and Wales under company
number 06639473 at registered address 61b Oxford Gardens, London W10 5UJ,
United Kingdom.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]