I am currently trying to implement a programatically loaded breadcrumb navigation. I set the model with the method:
Code: Select all
public void setModel(List<CategoryDTO> categories) {
model.getElements().clear();
model.getElements().add(getBasicCategory());
for (int i = categories.size() - 1; i >= 0; i--) {
CategoryDTO currentCategory = categories.get(i);
DefaultMenuItem item = DefaultMenuItem.builder()
.value(currentCategory)
.command("#{breadCrumbBean.redirect}")
.ajax(false)
.build();
model.getElements().add(item);
}
}
Code: Select all
public String redirect() {
System.out.println("Why do u not get called??!?!?");
return "";
}
Code: Select all
<p:panel id="breadcrumb">
<p:breadCrumb model="#{breadCrumbBean.model}">
</p:breadCrumb>
</p:panel>
Thanks for taking your time.
Kilian