special0ne
special0ne

Reputation: 6263

Working with buttons in a grid

I am using GWT 1.6 and I am pretty new to it.

My question is about the use of a button as part of a grid row. How can the onClick method that the button has refer to the data in the grid? How I can make the button be aware to its raw and the other data that exists on the same row?

Upvotes: 0

Views: 787

Answers (1)

nomad
nomad

Reputation: 917

  1. Adding anonymous click listeners refer to outer data (declared "final" of course).
  2. Keep Map (or Map) and one reusable click listener. Perhaps using some button id as a key would be better.
  3. In a listener refer to button's element and walk through DOM to the parent and down to required data.
  4. In some GWT extensions have data to list/grid/tree items binding mechanisms.

Do you need some details about options above?

Upvotes: 1

Related Questions