【发布时间】:2012-11-09 19:38:38
【问题描述】:
我目前正在处理来自 Ikarus widgetset 附加组件的 SlidingPanel。
当我在服务器端收到一些“特殊”事件时(例如,用户单击按钮或窗口已调整大小),我正在尝试使用 removeComponent() 从视图中删除此面板。但是组件在视图上仍然可见。我试图调试 UI 接收到的数据:
活动前:
-Response:
-change format=uidl pid=PID0
-com.vaadin.terminal.gwt.client.ui.VWindow id=PID0 height=590px width=815px immediate=true caption=ASM 5.0.7 name=1 theme=acs-reindeer resizable=true main=true layoutRelativeHeight=true layoutRelativeWidth=true
+variables
-com.vaadin.terminal.gwt.client.ui.VVerticalLayout id=PID127 height=100.0% width=100.0% margins=0 alignments={} expandRatios={PID133:1,}
+com.vaadin.terminal.gwt.client.ui.VHorizontalLayout
+com.vaadin.terminal.gwt.client.ui.VPanel
+com.vaadin.terminal.gwt.client.ui.VHorizontalLayout
+com.vaadin.terminal.gwt.client.ui.VUriFragmentUtility
+com.velociti.ikarus.widget.client.ui.VIkarusSlidingPanel
活动结束后:
-Response:
-change format=uidl pid=PID0
-com.vaadin.terminal.gwt.client.ui.VWindow id=PID0 height=995px width=1853px immediate=true caption=ASM 5.0.7 name=1 theme=acs-reindeer resizable=true main=true layoutRelativeHeight=true layoutRelativeWidth=true
+variables
-com.vaadin.terminal.gwt.client.ui.VVerticalLayout id=PID127 height=100.0% width=100.0% margins=0 alignments={} expandRatios={PID133:1,}
+com.vaadin.terminal.gwt.client.ui.VHorizontalLayout
+com.vaadin.terminal.gwt.client.ui.VPanel
+com.vaadin.terminal.gwt.client.ui.VHorizontalLayout
+com.vaadin.terminal.gwt.client.ui.VUriFragmentUtility
我从响应中清楚地看到 - 窗口不再包含 VIkarusSlidingPanel - 但实际上它仍然存在,因为它没有从 DOM 中删除。
- 唯一对我有帮助的 - 重新加载页面。
- 从同一事件的窗口中删除按钮 - 完美。
-
setVisible(false)不起作用。尝试时收到空白页 在此之后重新加载页面。 (抛出 javacript 异常)
有什么问题?有人可以帮我解决问题吗?
【问题讨论】:
-
如果你在同一个地方使用了一些其他的组件,删除会起作用吗?
-
是的,当然。我在帖子中写道:“在同一事件中从窗口中删除按钮 - 效果很好。” - 相反,按钮可以是任何组件,它会起作用。