Hello Thiago,

Success! It works.

Here is what I tried (was not able to understand the forceAttribute()
syntax...).

@AfterRender
public void afterRender(MarkupWriter writer) {
String id = clientElement.getClientId();
Element element = writer.getDocument().getElementById(id);
element.attribute("hreflang", lang);
}

Thanks a lot!
Will update the other post/question accordingly.
Regards,
Julien.

2012/5/4 Thiago H. de Paula Figueiredo <thiag...@gmail.com>

> On Fri, 04 May 2012 14:23:16 -0300, Julien Martin <bal...@gmail.com>
> wrote:
>
>  Hello Thiago,
>>
>
> Hi!
>
>
>  It does display a hreflang but in the "body" tag as follows:
>> <body hreflang="fr">
>>
>
> Ah, ok. :)
>
>
>  It now just boils down to locating the right "a" tag.
>>
>
> I'd try this: give an id (not t:id) to the link and, inside your mixin:
>
> /* ClientElement so your mixin can be used with any component that
> implements this interface, and ActionLink is one of them. */
> @InjectContainer
> private ClientElement clientElement;
>
> void afterRender(MarkupWriter writer) {
>        String id = clientElement.getClientId();
>        Element element = writer.getDocument().**getElementById(id);
>        element.forceAttributes(...);
> }
>
> Please let us know if this works. :)
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>

Reply via email to