I have an app that uses inputs from an ArrayList (listOne) to create Component entries.
At one point I want to repopulate the sidemenu with elements from a second ArrayList (listTwo, that is, in fact, a modification of listOne).
My problem is that the items from both lists appear in the sidemenu.
How can I refresh the sidemenu, so it only shows the items of the new list?
Any kind help would be appreciated.
Here is what I have so far:
tb = hi.getToolbar();
for (String s : listOne) {
testLabel = new Label(s);
tb.addComponentToSideMenu(testLabel);
}
public void test () {
tb.remove();
tb.removeAll();
tb.removeComponent(testLabel);
testLabel.remove();
for (String string : listTwo) {
testLabel = new Label(string);
tb.addComponentToSideMenu(testLabel);
}
}