new BaseMutableUINode(UIConstants.MARLIN_NAMESPACE,
UIConstants.PAGE_NAVIGATION_TREE_NAME);
navigationTree.setAttributeValue(UIConstants.START_LEVEL_ATTR,
3);
BoundValue treeRenderedBV = new HasDataBoundValue(
RootBoundValue.getBoundValue(), 3, true);
navigationTree.setAttributeValue(UIConstants.RENDERED_ATTR, treeRenderedBV);
// for PPR, an ID is required:
navigationTree.setAttributeValue(UIConstants.ID_ATTR, new BoundValue()
{
public Object getValue(UIXRenderingContext context)
{
UINode pageNode = context.getParentContext().getAncestorNode(0);
UIComponent component = pageNode.getUIComponent();
return component.getClientId(context.getFacesContext()) +
org.apache.myfaces.trinidadinternal.renderkit.uix.PageRenderer.TREE_SUFFIX;
}
}
);
// add the list
MutableUINode menuList =
new BaseMutableUINode(UIConstants.MARLIN_NAMESPACE,
UIConstants.PAGE_MENU_LIST_NAME);
menuList.setAttributeValue(UIConstants.LEVEL_ATTR,
3);
BoundValue listRenderedBV = new HasDataBoundValue(
RootBoundValue.getBoundValue(), 3, false);
menuList.setAttributeValue(UIConstants.RENDERED_ATTR, listRenderedBV);
MarlinBean navigation3Flow = new MarlinBean(UIConstants.FLOW_LAYOUT_NAME);
navigation3Flow.addIndexedChild(menuList);
navigation3Flow.addIndexedChild(navigationTree);
navigation3Flow.setAttributeValue(UIConstants.RENDERED_ATTR,
new OrBoundValue(treeRenderedBV,listRenderedBV));
pageLayout.setNamedChild(UIConstants.NAVIGATION3_CHILD, navigation3Flow);
// add the path
MutableUINode navigationPath =
new BaseMutableUINode(UIConstants.MARLIN_NAMESPACE,
UIConstants.PAGE_NAVIGATION_PATH_NAME);
BoundValue hasLocation =
XhtmlLafUtils.createIsRenderedBoundValue(UIConstants.LOCATION_CHILD);
navigationPath.setAttributeValue(UIConstants.RENDERED_ATTR,
new NotBoundValue(hasLocation));