ggeorg / gwt-mosaic

Automatically exported from code.google.com/p/gwt-mosaic
1 stars 0 forks source link

window.removeFromParent() dosen't remove modal #72

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a modal WindowPanel 
2. create a button
3. in the button listener do window.removeFromParent()

What is the expected output? What do you see instead?

the window to dissapear along with the modal thing. The window dissapears
but the modal remains

What version of the product are you using? On what operating system?
gwt-mosaic-v0.4.0-rc4, linux x64

Please provide any additional information below.

if before removeFromParent() we say setModal(false) nothing happens and if
we say hide() we get StackOverflowError

Original issue reported on code.google.com by florian....@gmail.com on 5 Mar 2010 at 1:33

GoogleCodeExporter commented 9 years ago
Hi,

I added:

http://code.google.com/p/google-web-toolkit/issues/list?thanks=4720&ts=126779840
1

For me this code works:

  public void onModuleLoad() {
    RootPanel.get().add(new Button("show...", new ClickHandler() {
      public void onClick(ClickEvent event) {
        final WindowPanel w = new WindowPanel();
        w.add(new Button("Close", new ClickHandler() {
          public void onClick(ClickEvent event) {
            w.hide();
          }
        }));
        w.showModal();
      }
    }));
  }

Please let me know if that works for you.

Original comment by georgopo...@gmail.com on 5 Mar 2010 at 2:15

GoogleCodeExporter commented 9 years ago
There is a limitation in PopupPanel: if setModal() or setGlassEnabled() is 
called
while the PopupPanel is visible, those methods do nothing.

Original comment by georgopo...@gmail.com on 5 Mar 2010 at 2:22

GoogleCodeExporter commented 9 years ago
it works with hide, thank you!; but hide is hide so it dosen't dispose the 
object. So
if the user opens and closes same type of window widgets and each time a new
WindowPanel object is created, isn't this bad for the browser?  

Original comment by florian....@gmail.com on 6 Mar 2010 at 3:04

GoogleCodeExporter commented 9 years ago
hide() will remove the window from DOM, use firebug to check it... or have a 
look at
the code for PopupPanel.

I posted already a patch to GWT:

http://code.google.com/p/google-web-toolkit/issues/detail?id=4720&can=4

but, until they close Issue 4720, the workaround is in SVN:

http://code.google.com/p/gwt-mosaic/source/detail?r=1449

Let me know if that is OK.

Thanks,
George. 

Original comment by georgopo...@gmail.com on 6 Mar 2010 at 3:52

GoogleCodeExporter commented 9 years ago
The workaround dosen't work. :(

I checkedout:
svn checkout http://gwt-mosaic.googlecode.com/svn/branches/GWT-2.0/ 
gwt-mosaic-read-only

the patch is present.
I then built with ant, included the new gwt-mosaic-0.4.0.jar in my project and
removed rc4, but the problem remains. Pease check

Regards,
Florian

Original comment by florian....@gmail.com on 8 Mar 2010 at 1:41

GoogleCodeExporter commented 9 years ago
strange, this works for me:

import org.gwt.mosaic.ui.client.WindowPanel;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.RootPanel;

public class Test implements EntryPoint {
  public void onModuleLoad() {
    RootPanel.get().add(new Button("show...", new ClickHandler() {
      public void onClick(ClickEvent event) {
        final WindowPanel w = new WindowPanel();
        w.add(new Button("Close", new ClickHandler() {
          public void onClick(ClickEvent event) {
            w.removeFromParent();
          }
        }));
        w.showModal();
      }
    }));
  }
}

Original comment by georgopo...@gmail.com on 8 Mar 2010 at 2:26

GoogleCodeExporter commented 9 years ago
Seems like the isuse was with netbeans. Altough I deselected mosaic rc4 library 
it
continued to use rc4 when compiling. So I removed rc4 completely and it works 
now.
Thank you so much!

Regards, 
Florian Chiş

Original comment by florian....@gmail.com on 9 Mar 2010 at 8:42

GoogleCodeExporter commented 9 years ago

Original comment by georgopo...@gmail.com on 9 Mar 2010 at 10:49