Declaring all possible values as parameters leads to high coupling. Just imagine declaring the parameters in a hierarchy of 5 components just to have it.
I'd use Environmental services to pass data between different component hierarchies. You can also apply the MVC pattern: create a service (thread scoped service or SSO) that acts as the model that the components can use to pull data from it. the service interface acts as the contract between component and model g, kris Von: Taha Hafeez <[email protected]> An: Tapestry users <[email protected]> Datum: 11.04.2011 18:00 Betreff: Re: Components communication with nested components But my problem is parent does not have any knowledge of the child. Child is either contained in the body somewhere or in an override block e.g Parent <t:container> <t:body> </t:container> Later in use <t:parent> <t:someChild/> </t:parent> so, parameters is not an option regards Taha On Mon, Apr 11, 2011 at 9:04 PM, Christian Köberl < [email protected]> wrote: > You could use parameters - Tapestry keeps them always in sync: > > public class Parent > { > // here Parent's state is bound to Child's state > @Component(parameters = "state=state") > private Child child; > > @Property > private String state; > } > > public class Child > { > @Parameter > private String state; > } > > see also http://tapestry.apache.org/component-parameters.html > > -- > Chris > > -- > View this message in context: > http://tapestry-users.832.n2.nabble.com/Components-communication-with-nested-components-tp6261431p6261909.html > Sent from the Tapestry Users mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
