0

Is there a way to add CellList members to Flow panel one by one instead of adding CellList itself to the panel?

for example.

private static final CellList<MyNodeInfo> myNodeCellList = 
     new CellList<MyNodeInfo>(MyNodeInfoCell.getInstance());
static List<MyNodeInfo> myNodeList = new ArrayList<MyNodeInfo>();
private static final FlowPanel flowPanel = new FlowPanel();

...
myNodeCellList.setRowData(myNodeList);
...
// <<<<<<<<<
flowPanel.add(myNodeCellList); 
// >>>>>>>>>
for (int i=0; i< myNodeCellList.size(); i++) {

  // want to add indivisual member of myNodeCellList
  flowPanel.add(...);
}
// **<- want to change like this!!**

An add() method of FlowPanel get Widget as an input parameter.

An CellList memeber can be an Element(with getElement()), but can't be a Widget.

Can each CellList member be a widget?

solikang
  • 53
  • 10

2 Answers2

0

If you don't care about the SelectionModel and things like that (keyboard navigation, etc.) then you can create one CellWidget per MyNodeInfo in your list.

But CellList (and other AbstractHasData widgets) is not designed for what you're looking after.

Thomas Broyer
  • 64,353
  • 7
  • 91
  • 164
  • Thanks. I will try! If CellWidget works, it needs not to use CellList. Nonetheless for handling of CellWidget click event I have to do some extra works. – solikang Apr 19 '12 at 08:12
0

Own answer.

It is enough to add myNodeCellList(whose rowData is myNodeList) to FlowPanel.

I add a container to warp FlowPanel.

Then works.

solikang
  • 53
  • 10