You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Christian Koeberl <ch...@porsche.co.at> on 2008/04/14 16:09:16 UTC

Re: Accessing a containing component parameter from within a 'child' component

> inherit: binding - however this doesn't work for me.
That should work.

With the inherit keyword you can forward parameters to sub-components, 
like this example of a zebra Grid component:

public class MyGrid
{
        @Parameter(required = true)
        private GridDataSource source;

        @Parameter
        private BeanModel model;

        @Parameter(defaultPrefix = TapestryConstants.
LITERAL_BINDING_PREFIX)
        private String reorder;

        @Component(inheritInformalParameters = true, parameters =
        { "rowClass=cycle:odd,even", "source=inherit:source",
                "model=inherit:model", "reorder=inherit:reorder" })
        private Grid grid;
}

-- 
Chris

Re: Accessing a containing component parameter from within a 'child' component

Posted by Jan Vissers <Ja...@cumquat.nl>.
Yep, you're right!

Thanks for the example.

-J.

On Mon, 2008-04-14 at 16:09 +0200, Christian Koeberl wrote:
> > inherit: binding - however this doesn't work for me.
> That should work.
> 
> With the inherit keyword you can forward parameters to sub-components, 
> like this example of a zebra Grid component:
> 
> public class MyGrid
> {
>         @Parameter(required = true)
>         private GridDataSource source;
> 
>         @Parameter
>         private BeanModel model;
> 
>         @Parameter(defaultPrefix = TapestryConstants.
> LITERAL_BINDING_PREFIX)
>         private String reorder;
> 
>         @Component(inheritInformalParameters = true, parameters =
>         { "rowClass=cycle:odd,even", "source=inherit:source",
>                 "model=inherit:model", "reorder=inherit:reorder" })
>         private Grid grid;
> }
> 
> -- 
> Chris


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