문제

I'm doing a project in Vaadin 7. In that I need to remove a row from Treetable.

I even couldn't find any way to remove any row from the Treetable. I used removeItem(), But, can't get it done.

can anyone help me in this issue?

도움이 되었습니까?

해결책

Next time, it would be good if you show us your sourceode. Then we can say you what the misstake is and how to resolve it.

If you have a TreeTable then you can remove all items with removeAllItems() or single items with removeItem(Object)

Now, if you add a item on the TreeTable, you have to give this item a itemID what you can use later to find this again and delete this item.

final TreeTable     treeTable   = new TreeTable();
//...
treeTable.addItem(new Object[]{"value", "value", "value"}, 0);
treeTable.addItem(new Object[]{"value", "value", "value"}, 1);
treeTable.addItem(new Object[]{"value", "value", "value"}, 2);
//...
treeTable.removeItem(1);

This very small example will create 3 Items in the your treeTable with the ID´s 0, 1 and 2. After this it delete the Item with the ID 1.

You can find here the Documentation about TreeTable and the method removeItem().

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top