Using PrimeFaces, I want to update/refresh a pages central layout unit based on user interaction with a menu (programmatically created MenuModel) that’s included in the same pages east layout unit. From what I can tell, this is not possible, but very well could be wrong. Thanks!
subMenu = new Submenu();
subMenu.setLabel("Sales");
subMenu.setIcon("ui-icon ui-icon-home");
–
private String currentPage; //holds identifier of current content panel
–
<!-- navigation panel -->
<p:layoutUnit position="west" resizable="false" size="216">
<ui:include src="./includes/navigationMenu.xhtml" />
</p:layoutUnit>
<!-- content panel -->
<p:layoutUnit position="center">
<ui:include src="/views/#{navigationBean.currentPage}.xhtml" />
</p:layoutUnit>
Thanks!
I implemented a listener..
added it to the MenuItem as well as a call to the the templates refresh()…
added the refresh method…
I really don’t care for this solution, but it’s better than the alternative, having untestable menu creation logic in markup.