Initializing component parameters using code (not via annotation).
------------------------------------------------------------------

                 Key: TAPESTRY-1149
                 URL: http://issues.apache.org/jira/browse/TAPESTRY-1149
             Project: Tapestry
          Issue Type: Improvement
    Affects Versions: 5.0
            Reporter: john
            Priority: Minor


In tapestry 5, most things are done in codes and I like that approach. So 
naturally I want to pass parameters to components in codes.
The parameters must be passed using attributes in html or in code like this:

@ComponentClass
public class Start {
        private String name = "john";

        @Component(parameters={"value=name"})
        private Echo echo;
}

I'd like to set parameters in code like following:

@ComponentClass
public class Start {
        private String name = "john";
        @Component
        private Echo echo;
        @SetupRender // or BeforeRender
        public void initComponents() {
                echo.setValue(name);
        }
}

It's more swing alike and has all the benefits of typed using like refactoring 
and static type check.
Currently, Tapestry will complain that the required parameters not filled. I 
think move the required parameter checking AFTER the @SetupRender will work. 
But another issue is that it seems that you can't set parameter value using 
method like setValue.
BTW, Wicket also uses this style of component parameter setting as I know.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to