UISiteManagement uiSiteManagement = uiPageNodeForm.getAncestorOfType(UISiteManagement.class);
UIPopupWindow uiNavigationPopup = uiSiteManagement.getChild(UIPopupWindow.class);
UINavigationManagement navigationManager = uiPageNodeForm.createUIComponent(UINavigationManagement.class, null, null);
navigationManager.setOwner(contextNavigation.getOwnerId());
navigationManager.setOwnerType(contextNavigation.getOwnerType());
UINavigationNodeSelector selector = navigationManager.getChild(UINavigationNodeSelector.class);
selector.setEdittedNavigation(uiPageNodeForm.getContextPageNavigation());
selector.initTreeData();
if (uiPageNodeForm.getSelectedParent() instanceof PageNode)
{
PageNode selectedParent = (PageNode)uiPageNodeForm.getSelectedParent();
selector.selectPageNodeByUri(selectedParent.getUri());
}
uiNavigationPopup.setUIComponent(navigationManager);
uiNavigationPopup.setWindowSize(400, 400);
event.getRequestContext().addUIComponentToUpdateByAjax(uiNavigationPopup.getParent());