Em Sat, 18 Jul 2009 17:23:52 -0300, Pete Poulos <pete.pou...@gmail.com>
escreveu:
Thanks for the reply Thiago,
You're welcome!
How would you set it up? If I have variable number of search criteria
(the user can leave some criteria empty, also some searches I've seen
let users add new criteria rows), wouldn't I need to have some sort of
key value pair listing? Or would you simply map all values as though
they had entered something? My search page will end up being fairly
complex.
As you said, there are at least two options: to put all parameters in the
context, used or not (Tapestry already encodes null as $N, so you don't
have to worry about it) or use some name/value scheme. This was discussed
some time ago in this list. The thread can be found here:
http://www.nabble.com/T5%3A-Passing-named-structured-type-params-in-URLs--td23453229.html).
Warning: the thread has two pages. Read them both.
In particular, could you show an example URL for the page you might
generate (ie, the alternative representation to the "?a=1&b=2" example
you have given?
There's no easy way to make Tapestry generate have ?a=1 parameters and use
them as the page activation context. Anyway, they're quite ugly.
I assume you don't mean "pagename/1/2/" because then
you can't deal with a variable argument list
You can deal with a variable argument list. Just use EventContext as the
parameter of your onActivate method:
public void onActivate(EventContext context).
(you would have to encode
every search parameter even if the user hasn't entered it right?).
In this scenario, you're right, because you wouldn't be able to know what
value was passed to what parameter.
Maybe something like "pagename/a=1/b=2"?
Tapestry would probably encode '=' in some way, so that's not the best
option.
--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org