tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Borut Bolčina <borut.bolc...@gmail.com>
Subject Re: [T5.3] Passing page activation context to a component
Date Wed, 24 Aug 2011 13:33:37 GMT
2011/8/24 Steve Eynon <steve.eynon@googlemail.com>

> If the component needs 2 string parameters to function, then it needs
> 2 string parameters! (Much like if a method needs 2 strings, then you
> need to pass 2 strings.)
>
>
Well, yes :-)


> Other alternatives are dependent on re-usability requirements:
>
> a) If the 2 strings are always used together then wrap them in a value
> object and pass that (you can pass anything as Component parameters).
>
>
Goes without saying - OO style.


> b) If the component is deeply nested and / or the strings need to be
> available to multiple components (and you're certain they'll always
> exist) then you could push them on the Environmental stack and not
> pass any parameters - just have the component query the stack.
>
>
Wouldn't that work just for one component? As soon as one component pops the
object(s) from the Environment stack, others won't have it (them) anymore?

Thanks,
borut


Steve.
> --
> Steve Eynon
>
>
> On 24 August 2011 18:07, Borut Bolčina <borut.bolcina@gmail.com> wrote:
> > Hi,
> >
> > if a component needs to have its parent's activation context (say two
> > strings), is the preffered way to pass it as parameters or is there a
> "less
> > code way"?
> >
> > The solution must not use a session.
> >
> > Cheers,
> > Borut
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message