Can I add a Listbox
as child to a Listitem
when the Listitem is selected? I'm currently working with hybris and the code I've tried is this :
Listitem listitem = new Listitem();
listitem.setValue(123);
listitem.setParent(this.secondListBox);
this.secondListBox.addItemToSelection(listitem);
And
private EventListener<Event> getListBoxListener() {
return (event -> {
this.listBox.getSelectedItems().forEach(listItem -> {
listItem.appendChild(this.secondListBox);
});
});
}
(The code shown is just for testing purposes !)
I want to achieve some expandable list for every Listitem with this approach, but I get this error :
Unsupported child for listitem: < Listbox null>
I know that the error already answers my question, but is there another way to do this? Thank you.