views:

43

answers:

2

Hello everyone,

I've yet another question. I'm working with GWT 2.0.4 and IE8 as well as FireFox (the latter only for comparison purpose). My application needs to load data and show it inside a table. There are about 60 columns and 150 rows to show.

Since the loading is dynamic - as soon as a dataset has been fetched, it's added to the table - I'm fine with slowdowns during loading process. However: when the table is completely loaded, I'd expect it to be pretty snappy and let me scroll it without much lag.

While the loaded table reacts in FireFox pretty good - it stays very responsive - Internet Explorer 8 is causing me a lot of headaches. In particular: as soon as the table finished loading and I try to scroll around or highlight a row, IE8 becomes VERY laggy and highlighting a row makes IE8 consume 50+% of CPU power.

I am not using any 3rd-party libraries and even displaying empty cells in a FlexTable still gives me the same issue.

I found some probably related issue here: http://stackoverflow.com/questions/1070856/smartgwt-listgrid-is-slow-but-only-in-internet-explorer . Unfortunately neither the issue there, nor the supplied links for SmartGWT solved my problem as I am not using SmartGWT. I do believe though that the problem is related.

Thank you very much and I'd be happy to try any suggestions.

Igor.

+1  A: 

If it's possible (and your description of the problem suggests so), use Grid instead:

A rectangular grid that can contain text, html, or a child Widget within its cells. It must be resized explicitly to the desired number of rows and columns.

Have a look at bulk table renderers @ GWT Incubator for a comparison of these approaches (it's a little dated, but the point that FlexTable is slower than Grid still holds ;)). The "bulk rendered" tables from the incubator are also an option, however keep in mind that those widgets might not be maintained any more (and for example, contain bugs) - or are rapidly maintained :D But looking at the source might at least point you in the right direction, if you wanted to roll out your own solution to this problem.

Igor Klimer
Thank you very much! I'Ve already found the BulkTableRenderer and I am now messing around with the PaginationScrollTable. It seems to be exactly what I need. It's all but easy to use nor are there any trivial examples - and they'd be very useful, because it's quite difficult to use that PaginationScrollTable. You have to specify a TableModel and a TableDefinition (columns) as well as overwrite certain abstract methods etc... Thank you very much though :)
Igor
If `PaginationScrollTable` caught your attention, they I'd recommend the latest GWT 2.1 milestone - it should contain the new Data Presentation widgets, which were created using experience gained from the (now unsupported and dropped) `PaginationScrollTable` (and probably some other tables from the incubator). You'll probably also have hard time finding good documentation and examples (can't say for sure, haven't checked lately), but it's a "safer" bet than `PaginationScrollTable`, IMHO.
Igor Klimer
See the [Bikeshed](http://code.google.com/p/google-web-toolkit/source/browse/#svn/branches/2.1/bikeshed) and it's [samples](http://code.google.com/p/google-web-toolkit/source/browse/#svn/branches/2.1/bikeshed/src/com/google/gwt/sample/bikeshed) for a starting point :) (sorry for double post, but the links made the comment too long)
Igor Klimer
A: 

highlighting a row makes IE8 consume 50+% of CPU power.

Maybe it's because you added mouse listeners to every row in your table. If so you could use :hover-pseudo-class in your css-files.

This article maybe helpful if you need to handle Events from a bunch of widgets in your table: http://code.google.com/intl/en/webtoolkit/doc/latest/FAQ_UI.html#As_the_application_grows,_event_handlers_seem_to_fire_more_slowl

Xo4yHaMope
Hey there :), I already checked that. I am using css :hover pseudo class in my css instead of using JavaScript. However: the problem still remains. I think that the problem lies in the way the IE javascript engine performs DOM-operations. Creating a huge table in pure HTML works fine, while causing serious lagging problems if created using JavaScript. I'll be trying the BulkTableRenderer and the associated classes (see the other answer above :) ). Thank you for your response though.
Igor
`:hover` is a great advice and everybody should be using it but... [IE6 doesn't support it for non-links](http://www.quirksmode.org/css/contents.html#t16) ;_; Unless, of course, your target doesn't include IE6, in which case, you are a happy web developer and can do all the cool stuff ;)
Igor Klimer