Em Fri, 08 May 2009 17:39:07 -0300, Andy Buckley
<andy.buck...@durham.ac.uk> escreveu:
So, is there a Tapestry meachnism for doing something like this? I can
do it right now, but I'd rather not have to fight the system. I would
expect Tapestry to do it a bit prettier than what I've shown, maybe
*something* like
.../view/irn/12349876/d/1,2,4
(yes, there are issues with telling what's a param name and what's a
value... I just mean this schematically) But right now I don't even know
where to start looking! Help, please!? ;)
Just use a List as the activation context value. For each named parameter
one want, add the name first, the value second.
The above URL would be constructed by Tapestry if you returned a List
populated like this:
List list = new ArrayList();
list.add("irn");
list.add(1245569);
list.add("d");
list.add("1,2,4");
Then, declare a onActivate(EventContext context) method and reconstruct
the pairs:
for (int i = 0; i < context.getCount() / 2; i++) {
String name = context.get(String.class, i * 2);
String value = context.get(String.class, i * 2 + 1) // instead of String,
you could use any type here
}
I have not tested this code, but I guess you get the idea. ;)
--
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