I am using a FastTree (Incubator widget), which is GWT Tree-like
widget implemented as a series of DIVs. This tree can have a fairly
large number of nodes, for example 250. When this widget is placed
into a table cell (for example in a VerticalPanel), the performance is
just awful. The CPU spikes to 100% and the browser is very
unresponsive. However, if I simply switch out the parent widget and
place the FastTree into a div rather than a table (for example in a
SimplePanel), everything is OK.

This is not in issue on IE7 or IE6, and certainly not on any real
browser like Firefox or Chrome. Has anyone faced anything similar? Any
ideas what the issue may be? Am I doing something I shouldn't be
doing?

Here's a simple reproducer, which is using a VerticalPanel. If you
comment out the three lines at the end and replace them with the
commented SimplePanel, things get much better.

        FastTree ft = new FastTree();
        for ( int i = 0; i < 250; ++i )
        {
            final HorizontalPanel hl = new HorizontalPanel()
            {
                @Override
                public void onBrowserEvent( Event e )
                {
                    super.onBrowserEvent( e );
                    switch ( DOM.eventGetType(e) )
                    {
                        case Event.ONMOUSEOVER:
                          getElement().getStyle().setBackgroundColor
( "red" );
                          break;
                        case Event.ONMOUSEOUT:
                          getElement().getStyle().setBackgroundColor
( "" );
                          break;
                      }
                }
            };
            hl.sinkEvents( Event.ONMOUSEOVER | Event.ONMOUSEOUT );
            hl.add( new InlineLabel("Item " + i) );
            hl.add( new CheckBox() );
            ft.addItem( hl );
        }
        // Comment three lines below, and replace with SimplePanel
        VerticalPanel vp = new VerticalPanel();
        vp.setWidth( "100%" );
        vp.add( ft );
//        SimplePanel vp = new SimplePanel();
//        vp.setWidget( ft );
        RootPanel.get().add( vp );

--

You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.


Reply via email to