Dan, you are missunderstanding the implementation.

To be more precise,
no matter how the mixin is applied, parameters are suuplied to the
component, not the mixin.

When you add a mixin to a component it is enhanced by it,
if a mixin has a parameter, component gets the parameter as if you
handcoded the parameter into it.

if you look at that way, you'll realize that sometimes parameter names
will overlap. in that case prefix the parameter name with mixin name.

Davor Hrg


On 7/13/07, Tae Lerch <[EMAIL PROTECTED]> wrote:

There seems to be some confusion here? (The confusion could also be on
my part)

Davor explains how to supply parameters to @Mixins (and
@MixinClasses)... "Instance Mixins".  Which is documented very well.

I think Dan is talking about an "implementation mixin" using the @Mixin
annotation.  The documentation does not explicitly state how this is
done.  Either that or Dan is using an implementation mixin where he
should be using an instance mixin as Davor explains.

In fact, parameters are supplied exactly the same way in both cases.  I
too was confused, I supposed that one should have something like:
@Mixin(parameters={...} for the implementation mixin, but it is
unnecessary.

Suppose that I have a component MyComp which has an "implementation
mixin" of MyMixin which has a parameter parm1.  Thus when using MyComp
in some page or component:

@Component(parameters={"mymixin.parm1=something"})
private MyComp myComp;

Note that @Mixins (instance mixin annotation) is not specified since it
is part of MyComp.  Also, "parm1=something" will work if mycomp does not
also have a parameter called parm1.

--Tae Lerch


Davor Hrg wrote:
> please check the bottom of the page... also read the page again
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/mixins.html
>
> @Mixin annotation just say what mixin you are adding,
> after that the component is joined with the mixin so
> to define a parameter, you can do it in the template or via
> @Component annotation
>
> the example on the docs shows it:
>
> @Component(parameters={"param=someValue", . . . })
@Mixin("Autocomplete")
> private TextField _userId;
>
> Davor Hrg
>
>
> On 7/13/07, Dan Adams <[EMAIL PROTECTED]> wrote:
>>
>> Yeah, my mixin has a required parameter but when I use it like this in
>> my component:
>>
>> @Mixin
>> private Confirm confirm;
>>
>> I have no way of specifying the parameters. It seems like @Mixin needs
>> to accept a parameters parameter.
>>
>> On Fri, 2007-07-13 at 07:28 +0200, Davor Hrg wrote:
>> > I belive you can declare parameters in you mixin just as you would
>> in a
>> > component,
>> > I haven't tried it yet, but if you hadn't, please read this page from
>> > tapestry site:
>> >
>> > http://tapestry.apache.org/tapestry5/tapestry-core/guide/mixins.html
>> >
>> > Davor Hrg
>> >
>> > On 7/12/07, Dan Adams <[EMAIL PROTECTED]> wrote:
>> > >
>> > > When you apply a mixin with @Mixin how do you specify parameters?
Is
>> > > there an open ticket for this?
>> > >
>> > > --
>> > > Dan Adams
>> > > Senior Software Engineer
>> > > Interactive Factory
>> > > 617.235.5857
>> > >
>> > >
>> > >
>> ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > > For additional commands, e-mail: [EMAIL PROTECTED]
>> > >
>> > >
>> --
>> Dan Adams
>> Senior Software Engineer
>> Interactive Factory
>> 617.235.5857
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>


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


Reply via email to