-
18 Feb 2013 12:06 PM #1
MessageBox not appearing until work is done on grid
MessageBox not appearing until work is done on grid
I'm having trouble getting any type of messagebox to appear. I have a tree grid that with this UI can contain hundreds of nodes. The current example I have is 888 total items in the grid. When the grid gets this large the collapse/expand methods can take a large amount of time during which the browser appears as it is hung.
I have placed a collapse button on my toolbar and in the selection method did this:
MessageBox mb = MessageBox.wait("XML Preview", "Collapsing tree", "Please wait...");
treeGrid.collapseAll();
mb.close();
The messagebox is never appearing at all...to see if it was appearing and closing i deleted the mb.close line and tried it again...the MessageBox doesn't appear until after all of the collapseAll work is done.
I thought maybe this is happening because the grid is being updated so it appears over the top of the mb. To make sure that wasn't the case I shrunk my grid window and see nothing appearing behind it.
Any help would be appreciated. I've tried this several ways..on the before collapse/collapse grid events..beforeselect/select button events..view ready.. No luck..
-
19 Feb 2013 5:45 AM #2
The problem is that in your browser, everything is single threaded. You need to add some time between showing the MessageBox and collapsing your entries.
Code:MessageBox mb = MessageBox.wait("XML Preview", "Collapsing tree", "Please wait..."); Scheduler.get().scheduleDeffered(new Scheduler.Command() { ... treeGrid.collapseAll(); mb.close(); .. }
-
19 Feb 2013 10:00 AM #3
Thank you for the response, knew it was something like that.
Instead of the wait I'd like to do a progress bar but thats even worse..can't update the progress bar for the same exact problem..tried nesting another defer in there but didn't work ...If not this is good enough thanks a lot
-
26 Mar 2013 11:35 AM #4
I would add your treeGrid code into an Events.Show listener, which you could add to the MessageBox.getDialog().
André


Reply With Quote