I have a use-case where I have a list of lists (actually a menu hierarchy) and would like to use these in a nested dom-repeat tag. The first list works fine, but including a list as an attribute of the model then fails.
public interface StoreFrontViewModel extends TemplateModel {
@Include({"name", "tagId", "imageSource", "classification"})
void setProducts(List<ProductMpr> products);
List<ProductMpr> getProducts();
@Include({"menuName", "subMenu"})
void setMenuItems(List<MenuItem> menuItems);
List<MenuItem> getMenuItems();
}
public class MenuItem {
public String menuName;
public List<MenuItem> subMenu;
public MenuItem() {
}
public MenuItem(String pc, List<MenuItem> classifications) {
this.menuName = pc;
this.subMenu = classifications;
}
public String getMenuName() {
return menuName;
}
public void setMenuName(String menuItem) {
this.menuName = menuItem;
}
public List<MenuItem> getSubMenu() {
return subMenu;
}
public void setSubMenu(List<MenuItem> subMenu) {
this.subMenu = subMenu;
}
}
The above code fails on the @Include subMenu attribute.
Does anyone know if this is possible at all?