titleBox.setHeight("15px");
titleBox.setWidth("100%");
titleBox.setStyle("background-color: red;");
titleBox.setParent(vbox);
popLabel = new Label();
popLabel.setParent(titleBox);
popLabel.setValue("Customer Details");
popLabel.setStyle("color: white; ");
} else {
// clear old stuff
vbox.getChildren().clear();
titleBox = new Hbox();
titleBox.setHeight("15px");
titleBox.setWidth("100%");
titleBox.setStyle("background-color: red;");
titleBox.setParent(vbox);
popLabel = new Label();
popLabel.setParent(titleBox);
popLabel.setValue("Customer Details");
popLabel.setStyle("color: white; ");
popup.close();
}
Component comp = event.getTarget();
if (comp instanceof Listcell) {
// System.out.println("1: " + comp.toString());
// System.out.println("2: " + ((Listcell)
// comp).getLabel().toString());
// System.out.println("3: " + comp.getParent().toString());
// get the parent object of the listcell, should be a listitem
Component parentComponent = comp.getParent();
if (parentComponent instanceof Listitem) {
// get a list of listcell that resides in the listItem
List list = parentComponent.getChildren();
// for all listcells we add a label with its value
for (Object object : list) {
if (object instanceof Listcell) {
popLabel = new Label();
popLabel.setParent(vbox);
popLabel.setValue(((Listcell) object).getLabel().toString());
}
}