You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "john (JIRA)" <de...@tapestry.apache.org> on 2007/04/20 15:27:17 UTC

[jira] Created: (TAPESTRY-1421) Allow onActivate event handler method to receive dynamic parameters

Allow onActivate event handler method to receive dynamic parameters
-------------------------------------------------------------------

                 Key: TAPESTRY-1421
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1421
             Project: Tapestry
          Issue Type: Bug
          Components: tapestry-core
    Affects Versions: 5.0
            Reporter: john


Currently the onActivate method can have some parameter, and tapestry will automatically adapt to it and call the method with context strings.
But for some pages, the parameters can be variant.
I suggest ending String[] parameter for  receive the rest context parameters, you can even use the Java 5's vararg for this.
Say I have an onActivate method like this:
public void onActivate(String name, int age, String... restParameters) {
  //do something
}
if I use "..../Page/john/30/p1/p2/p3" to call the page, the parameter received by onActivate method will be :{"john", 30, {"p1", "p2", "p3"}}

-- 
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


[jira] Updated: (TAPESTRY-1421) Allow onActivate event handler method to receive dynamic parameters

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1421?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAPESTRY-1421:
-------------------------------------------

    Issue Type: Improvement  (was: Bug)

> Allow onActivate event handler method to receive dynamic parameters
> -------------------------------------------------------------------
>
>                 Key: TAPESTRY-1421
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1421
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0
>            Reporter: john
>
> Currently the onActivate method can have some parameter, and tapestry will automatically adapt to it and call the method with context strings.
> But for some pages, the parameters can be variant.
> I suggest ending String[] parameter for  receive the rest context parameters, you can even use the Java 5's vararg for this.
> Say I have an onActivate method like this:
> public void onActivate(String name, int age, String... restParameters) {
>   //do something
> }
> if I use "..../Page/john/30/p1/p2/p3" to call the page, the parameter received by onActivate method will be :{"john", 30, {"p1", "p2", "p3"}}

-- 
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


[jira] Closed: (TAPESTRY-1421) Allow onActivate event handler method to receive dynamic parameters

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1421?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAPESTRY-1421.
------------------------------------------

    Resolution: Won't Fix
      Assignee: Howard M. Lewis Ship

You can now receive your parameters as an EventContext, which can a) be queried for length and b) automatically type coerce URL strings to server-side objects.  

> Allow onActivate event handler method to receive dynamic parameters
> -------------------------------------------------------------------
>
>                 Key: TAPESTRY-1421
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1421
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0
>            Reporter: john
>            Assignee: Howard M. Lewis Ship
>
> Currently the onActivate method can have some parameter, and tapestry will automatically adapt to it and call the method with context strings.
> But for some pages, the parameters can be variant.
> I suggest ending String[] parameter for  receive the rest context parameters, you can even use the Java 5's vararg for this.
> Say I have an onActivate method like this:
> public void onActivate(String name, int age, String... restParameters) {
>   //do something
> }
> if I use "..../Page/john/30/p1/p2/p3" to call the page, the parameter received by onActivate method will be :{"john", 30, {"p1", "p2", "p3"}}

-- 
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


[jira] Commented: (TAPESTRY-1421) Allow onActivate event handler method to receive dynamic parameters

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12490669 ] 

Howard M. Lewis Ship commented on TAPESTRY-1421:
------------------------------------------------

This looks like a good idea; you can kind of get this today by declare a single parameter of type Object[] ... then inject the TypeCoercer to get it to strings, longs, dates, etc.  

I don't think that Javassist currently lets us see if a parameter is a varargs or not.  There may be a way to get at the underlying raw bytecode to determine this.

> Allow onActivate event handler method to receive dynamic parameters
> -------------------------------------------------------------------
>
>                 Key: TAPESTRY-1421
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1421
>             Project: Tapestry
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0
>            Reporter: john
>
> Currently the onActivate method can have some parameter, and tapestry will automatically adapt to it and call the method with context strings.
> But for some pages, the parameters can be variant.
> I suggest ending String[] parameter for  receive the rest context parameters, you can even use the Java 5's vararg for this.
> Say I have an onActivate method like this:
> public void onActivate(String name, int age, String... restParameters) {
>   //do something
> }
> if I use "..../Page/john/30/p1/p2/p3" to call the page, the parameter received by onActivate method will be :{"john", 30, {"p1", "p2", "p3"}}

-- 
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