The right syntax is :
<t:textfield t:id="fieldA" t:mixins="FieldMixin" />

2012/4/12 resign <sergejb...@yahoo.de>

> Hi,
> i search an example how to create and use mixins.
> Unfortunately, i cannot found anything to become smarter.
> My idea - i write a mixin which set TextField disabled or not depends on
> logged user.
>
> My example code
>
> class FieldMixin{
> @Inject
> private ComponentResources  resources;
>
> private Element element;
>
> @SessionState(create = false)
> private WebUser         user;
>
> void beginRender(MarkupWriter writer){
>  element = writer.getElement();
>  if(user.getName().equels("admin"){
>     element.attribute("disabled", "disabled");
>  }
> }
> }
>
> TML
> ...
> <t:textfield t:id="fieldA" t:mixin="FieldMixin" />
> ...
>
>
> Is this the right way?
> How can i get it running?
>
> greeting,
> resign
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/T5-2-6-mixins-example-tp5635318p5635318.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Emmanuel DEMEY
Ingénieur Etude et Développement
ATOS Worldline
+33 (0)6 47 47 42 02
demey.emman...@gmail.com
http://emmanueldemey.fr

Twitter : @gillespie59

Reply via email to