I try to make a reusable Horizontal splittable panel in GXT 3.
I found this post. I adapted with sencha.gxt imports and I came up with this solution :
public class WestCenter extends BorderLayoutContainer {
private ContentPanel westPanel;
private ContentPanel centerPanel;
public WestCenter(){
westPanel = new ContentPanel();
centerPanel = new ContentPanel();
BorderLayoutData westData=new BorderLayoutData(800);
westData.setSplit(true);
westData.setCollapsible(true);
westData.setMargins(new Margins(0,5,0,0));
BorderLayoutData centerData=new BorderLayoutData();
setWestWidget(westPanel, westData);
setCenterWidget(centerPanel,centerData);
}
public void setWestHeadingText(String text){
this.westPanel.setHeadingText(text);
}
public void setCenterHeadingText(String text){
this.centerPanel.setHeadingText(text);
}
@UiChild(tagname = "westContent")
public void setWestContent(Widget widget){
this.westPanel.setWidget(widget);
}
@UiChild(tagname = "centerContent")
public void setCenterContent(Widget widget){
this.centerPanel.setWidget(widget);
}
Problem
I have a very weird behavior : I can drag the split bar from right to left but not from left to right. Hence, the dragging from right to left cannot be undone!
Any ideas?
I tried:
... without success.
The answer was in the javadoc:
When split = true, it is common to specify a minSize and maxSize for the region.
The default values for minSize
and maxSize
were actually far too small.