【发布时间】:2011-01-22 17:13:01
【问题描述】:
我目前正在使用 SmartGWT,并且一直在尝试获得一种将面板(例如 gwt Standard VerticalPanel)包含到智能 GWT 窗口中的方法。 VerticalPanel 的原因是我可以将小部件附加到verticalpanel 对象而无需重新设置整个内容,例如:
HTMLPane hPaneObj = new HTMLPane();
hPaneObj.setContents("Foo");
现在要追加,我只能看到我能做到:
hPaneObj.setContents(hPaneObj.getContents() + "Bar");
这不是我需要的。
添加 VerticalPanel 后出现问题,即使使用 true 作为参数调用的 'setCanSelectText' 方法,我也无法在窗口中选择任何文本。以下是我整理的一个简短示例:
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();
}
我很惊讶,但是 HTMLPane 不允许我在不重置整个内容的情况下追加。
任何建议都将不胜感激,但我需要能够“附加”到面板。我不是特别喜欢使用垂直面板的想法,但是我需要找到一种方法来允许上述内容或允许我允许垂直面板可访问,即选择文本。
非常感谢
克里斯托弗。
【问题讨论】:
标签: java javascript gwt smartgwt