tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Filip S. Adamsen (JIRA)" <...@tapestry.apache.org>
Subject [jira] Commented: (TAPESTRY-2613) Annotation to map query parameter to event handler method
Date Thu, 21 Aug 2008 22:10:44 GMT

    [ https://issues.apache.org/jira/browse/TAPESTRY-2613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12624495#action_12624495
] 

Filip S. Adamsen commented on TAPESTRY-2613:
--------------------------------------------

If I may offer my perspective on this...

I've recently implemented my own @QueryParameter annotation that is put on page fields. It's
powered by a ComponentClassTransformWorker that injects the request parameter with the given
name into the field.

It's very simple right now, but it works. What's annoying is that I had to override PageLink,
ActionLink, EventLink, and Form to take a map of query parameters to add to the URL. But it's
worth it.

I suppose it could be integrated into LinkFactory somehow, perhaps by enhancing each page
class with a method that returns a map of all non-default query parameters that could then
be added to each link sort of like the activation context - of course with an option to override
it like you can override the page context.

That's my $0.02 anyhow. I hope it made sense.



> Annotation to map query parameter to event handler method
> ---------------------------------------------------------
>
>                 Key: TAPESTRY-2613
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2613
>             Project: Tapestry
>          Issue Type: New Feature
>          Components: tapestry-core
>    Affects Versions: 5.0.14
>            Reporter: Howard M. Lewis Ship
>
> It would be nice, is some cases, to have Tapestry map query parameters to event handler
method parameters, rather than path info.  This is typically about the Ajax case, where it
is more reliable (and easier) to take a URL and add query parameters to it than it is to add
extra path info.
> public void onActionFromAjaxWidget(@QueryParameter("action") String widgetAction, @QueryParameter("count")
int count) { .... }
> This does raise some tricky questions: i.e., what do you do when only some of the parameters
have @QueryParameter?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message