I try to create a custom widget (that response to click to any text, annotate / highlight any text segment, and scroll to any text position) for my MISO project.
Currently I'm trying to create the Vaadin custom widget with GWT ScrollPanel. However one thing is driving me crazy: ScrollPanel can only be sized with absolute size (px, etc.) not relative size (100%). I posted a question here:
http://stackoverflow.com/questions/41110336/how-to-use-scrollpanel-with-relative-size
In this page I am listing all approaches I can think of (work or not) and test, and will record the result.
No. This simply does not work and I do not expect it to work.
Reference here: http://stackoverflow.com/questions/1329849/gwt-relative-width
No. This does not work, somehow the style setting just goes disappear. What did GWT do?
Yes this works.
public class My100PctScrollPanel extends ScrollPanel {
@Override
public void onResize() {
Window.alert("on resize");
this.setWidth(this.getParent().getOffsetWidth()+"px");
this.setHeight(this.getParent().getOffsetHeight()+"px");
super.onResize();
}
}
compositeRoot = new ResizeLayoutPanel();
scrollPanel = new My100PctScrollPanel();
compositeRoot.clear();
compositeRoot.add(scrollPanel);
}
https://groups.google.com/forum/#!msg/Google-Web-Toolkit/z7IDYJuboXg/HcC9wQHAY4EJ