tags:

views:

105

answers:

1

I'm creating a table using GWT, and in certain cells of the table, I want to store a piece of data in that cell's Widget for use in the Widget's handler callback. I can't seem to find an API method such as widget.setData(key, value);. How do I (or can I) accomplish this?

+1  A: 

You could subclass the widget you want - and add the appropriate members and get/set methods.

The table example may be better served by storing the object inside a button instance, i.e an 'Edit' button.

Alternatively, you could maintain a map of objects that relate to each row index. This would save creating a lot of unnecessary widgets.

AlexJReid