You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org> on 2007/06/24 20:47:26 UTC

[jira] Commented: (TAPESTRY-1149) Initializing component parameters using code (not via annotation).

    [ https://issues.apache.org/jira/browse/TAPESTRY-1149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507705 ] 

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

We've been down this path a bit before with Kent Tong's take on Tapestry 5 which largely did away with bindings. To me it's a crapshoot: you either put public getters on the container, or public setters (and some new logic) into the component. I'm trying to avoid designs that introduce too many ways to accomplish a task.  In your example,

@Component("value=literal:name")
private Echo echo;

would get the job done ... of course, this isn't a realistic example.

One of the functions of the overall parameter design is to ensure that at the end of the request, all client-specific data is expunged, to prevent client-specific data from "leaking" into pages that will be used by other users.

> Initializing component parameters using code (not via annotation).
> ------------------------------------------------------------------
>
>                 Key: TAPESTRY-1149
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1149
>             Project: Tapestry
>          Issue Type: Improvement
>    Affects Versions: 5.0
>            Reporter: john
>            Priority: Minor
>             Fix For: 5.0
>
>
> 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.
-
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