7

I'm currently dealing with SlidingPanel from Ikarus widgetset add-on. I'm trying to remove this Panel from the view using removeComponent() when I receive some "special" event on the server-side (for example user clicked the button or window was re-sized). But the component is still visible on the view. I was trying to debug the data UI receives:

Before event:

-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

After event:

-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

What I clearly see from the response - the window doesn't contain VIkarusSlidingPanel anymore - but in fact it is still there because it was not removed from the DOM.

  • The only thing that helps me - reload page.
  • Removing buttons from the window on the same event - works perfect.
  • setVisible(false) doesn't work. I receive a blank page when trying reload page after this. (the javacript exception is thrown)

What is the problem? Can somebody help me with a workaround?

Viktor
  • 189
  • 1
  • 6
  • If you use some other component in the same place, will the removing work? – miq Nov 28 '12 at 08:00
  • Yes, of course. I have written in the post: "Removing buttons from the window on the same event - works perfect." - instead button could be any component and it will work. – Viktor Nov 29 '12 at 21:59

1 Answers1

0

Check if your component have an immediate state. In Vaadin it just setting by setImmediate(true) on component. And I think, that the best way to remove component is just hide it by setVisible(false).

Anyway, hope you'll find a solution.

Yan Pak
  • 1,767
  • 2
  • 19
  • 15
  • Note that hiding components in vaadin is very powerful approach since when component is hidden, its state is preserved on server side and client contains no data about the hidden component at all - so it is not like component is hidden with css or javascript. So it is safe to hide a component and client will receive no information about it at all. – Vojtech Ruzicka Mar 06 '15 at 08:53