I found a solution to my problem.
By exploring the BorderLayoutContainer class which was the last gxt3 component before my gxt2 grid, I found the applyLayout method. This method call the ResizeContainer applyLayout.
On this method we can see that if the widget child is not a GXT3 Component, a specific action is done :
Code:
if (widget instanceof Component) {...} <- gxt3 component
else {
XElement.as(widget.getElement()).setSize(width, height, true);
if (widget instanceof RequiresResize) {
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
((RequiresResize) widget).onResize();
}
});
}
}
So I created my wrapper like that :
Code:
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.user.client.ui.RequiresResize;
public class ThreeComponentWrapper extends LayoutContainer implements RequiresResize {
private LayoutContainer layoutContainer;
public ThreeComponentWrapper(LayoutContainer layoutContainer) {
this.layoutContainer = layoutContainer;
setLayout(new FitLayout());
add(layoutContainer);
}
@Override
public void onResize() {
layout(true);
}
}
We have to note that on ResizeContainer.applyLayout methode, the new size is set to the wrapper object :
Code:
XElement.as(widget.getElement()).setSize(width, height, true);
With the layout(true), my gxt2 wrapper component propagate the resize event.
I'm not sure it's the best way to do but it solve my problem.
Do not hesistate to comment!
YannickM