I have a SplitLayoutPanel where one of the child components is FlowPanel. I expanded the FlowPanel to create a ResizableFlowPanel that implements ProvidesResize and RequiresResize, because the FlowPanel has child components that also need to be resized.
When dragging SplitLayoutPanel dividers, how do you get the new size of the child components? I tried using getOffsetWidth()both getElement().getOffsetWidthfrom FlowPanel and both return the original size, not the new size.
What am I doing wrong?
Here's a subclass of FlowPanel I'm trying:
class ResizableFlowPanel extends FlowPanel implements ProvidesResize, RequiresResize {
ResizableFlowPanel() {
super();
}
public void onResize() {
int li_width = this.getOffsetWidth();
int li_height = this.getOffsetHeight();
System.out.println("ResizableFlowPanel:: width : " + li_width + "; height: " + li_height);
for (Widget child : getChildren()) {
if (child instanceof RequiresResize) {
((RequiresResize) child).onResize();
}
}
}
}
System.out , , , . , , - getOffsetHeight().
, onResize() FlowPanel, . FlowPanel, , SplitLayoutPanel, .
, , SplitLayoutPanel, RequiresResize, ? onResize() ?