celltable and MultiSelectionModel: manual element changes (like element-title) disappear

85 views
Skip to first unread message

divStar

unread,
Oct 19, 2011, 9:56:34 AM10/19/11
to Google Web Toolkit
Hi guys!

I'm having some strange issue - I don't know whether it's a bug or
just my own mistake.

I'm having a list of Characters (name, age, class etc.), which are
displayed using a CellTable. It all works fine except that I haven't
found a good way to add tooltips to the row elements.

In order to solve my problem, I'm doing something like this:

celltable.getRowElement(rowNumber).getCells().getItem(0).setTitle("tooltip");

I'm doing this for each column-element of a given row (e.g. name, age,
class etc.).

Now HERE comes the problem:
whenever the selection is changed (e.g. I check/uncheck the checkbox
or the classes used for styling are changed for any reason) - the
tooltip disappears.

Is there a way to preserve the set tooltip? Or if I were to reapply
the tooltip - how would I go about doing that?

Thank you guys in advance!

Thomas Broyer

unread,
Oct 19, 2011, 10:18:38 AM10/19/11
to google-we...@googlegroups.com
You'd rather use a Cell that generates a title="" attribute.

The reason for the title="" disappearing is that CellTable "redraws", and does so by generating the table and using innerHTML, and thus replacing the whole DOM subtree.

In GWT 2.5, you'll be able to provide your own CellTableBuilder (you'll probably subclass the DefaultCellTableBuilder) and add a title="" attribute on any <tr> or <td> you'd like.

divStar

unread,
Oct 19, 2011, 10:43:01 AM10/19/11
to Google Web Toolkit
Ah! Alright.. I've just inspected the AbstractCellTable class and it
also says the exact same thing you just posted (@deprecated as of GWT
2.5, use a {@link CellTableBuilder} to customize the table structure
instead). I think I'll do this then! Thanks.
Reply all
Reply to author
Forward
0 new messages