You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Fernando Padilla <fe...@alum.mit.edu> on 2009/03/31 22:21:07 UTC

access component from mixin

What is the best way to get the component a mixin i applied to, from 
within the mixin?

I want to access the clientId of the component that the mixin has been 
tied to.  How would I do that?

pseudo-code:

mixin {
  afterRender {
   getComponent().getClientId();
  }
}

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


Re: access component from mixin

Posted by Inge Solvoll <in...@gmail.com>.
I think this is the "standard" way of getting the clientId of the mixin's
container:

  @InjectContainer
  private ClientElement container;

On Tue, Mar 31, 2009 at 10:24 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> Em Tue, 31 Mar 2009 17:21:07 -0300, Fernando Padilla <fe...@alum.mit.edu>
> escreveu:
>
>  What is the best way to get the component a mixin i applied to, from
>> within the mixin?
>>
>> I want to access the clientId of the component that the mixin has been
>> tied to.  How would I do that?
>>
>
> I guess it is by using @InjectComponent:
>
> @InjectComponent
> private YourComponent component;
>
> component.getClientId();
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: access component from mixin

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Tue, 31 Mar 2009 17:21:07 -0300, Fernando Padilla <fe...@alum.mit.edu>  
escreveu:

> What is the best way to get the component a mixin i applied to, from  
> within the mixin?
>
> I want to access the clientId of the component that the mixin has been  
> tied to.  How would I do that?

I guess it is by using @InjectComponent:

@InjectComponent
private YourComponent component;

component.getClientId();

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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