I am currently working with SmartGWT and have been trying to obtain a way of including a panel such as the gwt Standard VerticalPanel into a smart GWT window. The reason for the VerticalPanel is that I can append widgets to the verticalpanel object without having to re-set the entire content, for example:
HTMLPane hPaneObj = new HTMLPane();
hPaneObj.setContents("Foo");
Now to append I can only see that I can do:
hPaneObj.setContents(hPaneObj.getContents() + "Bar");
which is not what I need.
The problem arises after I've added the VerticalPanel, I cannot select any text within the window even with the 'setCanSelectText' method called with true as the parameter. Below is a short example I put together:
public void onModuleLoad() {
Window theWindow = new Window();
theWindow.setTitle("Good evening");
theWindow.setWidth(500);
theWindow.setHeight(500);
theWindow.setCanSelectText(true);
VerticalPanel vp = new VerticalPanel();
vp.add(new HTML("foo"));
vp.add(new HTML("bar"));
theWindow.addItem(vp);
Canvas canvas = new Canvas();
canvas.addChild(theWindow);
canvas.draw();
}
I am quite suprised however that HTMLPane doesn't allow me to append without resetting the entire contents.
Any advice would be appreciated however I need to do be able to 'append' to a panel. I don't particularly like the idea of using a vertical panel however I need to either find a method of allowing the aforementioned or allowing me to allow the verticalpanel to be accessible, i.e. selecting the text.
Many thanks
Christopher.