0

This is a GWT question.

I need to create a hierarchical view of a data set. Let me describe what this hierarchical view is supposed to be:

  1. Lay down a rectangle that is 640 by 480 pixels on your screen.
  2. Now embed 4 rectangles inside the rectangle from the previous step.
    • The 4 rectangles shall evenly take up the space from the enclosing rectangle.
  3. Continue recursively embedding 4 rectangles inside each 4 rectangle...
  4. So on and so forth until a stop condition (like stop recursing at level N).

I plan on doing this with GWT's CellTable. I know how to make a CellTable out of the various out-of-the-box Cell's (what I mean to say is: all the classes that implement the Cell interface ).

But I can't figure out how to make a CellTable of Widgets... or a CellTable of CellTables. I guess my question boils down to... How would you make a new Cell type that is: WidgetCell or CellTableCell?


UPDATE:

I found an answer that describes how to make a Cell out of a Widget: how-can-i-put-a-widget-in-a-celltable-cell

Given the above answer, is my original idea of making a CellTable out of CellTables practically feasible? Is there a more elegant solution? Am I on the right-track?

Community
  • 1
  • 1
Trevor Boyd Smith
  • 18,164
  • 32
  • 127
  • 177
  • the mentioned post will not work because only the HTML is appended to to the DOM but theres no event handling. I am wondering what you are trying to achieve? Maybe theres another way to do this... – Daniel Kurka May 15 '11 at 06:37
  • @Riley, he pointed out that CellTable supports "paging". I do not need the paging aspect that CellTables support. – Trevor Boyd Smith May 16 '11 at 13:19
  • @DanielKurka when you say "only the HTML is appended to the DOM but theres no event handling". I understand it as "using the HTML representation will get you the visual appearance ONLY... but you will lose all the interactivity/javascript of the element embedded in the CellTable" is my understanding correct? – Trevor Boyd Smith May 16 '11 at 13:52

1 Answers1

1

CellTables do not support widgets. Grid or FlexTable might work better for you, since they do accept widgets - you could make a Grid of CellTables, for instance. Unfortunately, there is no built-in solution that accepts widgets and provides paging.

Riley Lark
  • 20,660
  • 15
  • 80
  • 128
  • The default CellTable is much more attractive looking than the default Grid. If I use a grid, is there anyway to get the "mouse over" highlighting that CellTable has by default in my grid? – Trevor Boyd Smith May 16 '11 at 12:52
  • No, Grids just make ``s and put Widgets in them. They do provide events to which you can respond, though, and they provide formatters so you can apply your own styles. Mouse over highlighting of rows would probably take something like 40 lines of code and 10 lines of css.
    – Riley Lark May 16 '11 at 14:28