There's another solution, but it just works when the component is a
ClientElement:
@MixinAfter
public class MyMixin {
@InjectContainer
private ClientElement clientElement;
void afterRender(MarkupWriter writer) {
Element element =
writer.getElementById(
@MixinAfter
public class MyMixin {
void afterRender(MarkupWriter writer) {
List children = writer.getElement().getChildren();
if (!children.isEmpty()) {
Element lastChild = (Element) children.get(children.size() - 1);
doStuff(lastChild);
}
}
}
I need a mixin which can be attached to different elements (with and
without body). The mixin wraps original element with another and adds some
classes to the original. How I can get current element while render? I'd
use writer.getElement() in render body but its not triggered in components
with em