return;
}
}
PageNode pageNode = uiPageNodeForm.getPageNode();
if (pageNode == null)
pageNode = new PageNode();
uiPageNodeForm.invokeSetBindingBean(pageNode);
UIPageSelector2 pageSelector = uiPageNodeForm.getChild(UIPageSelector2.class);
if (pageSelector.getPage() == null)
pageNode.setPageReference(null);
UIFormInputIconSelector uiIconSelector = uiPageNodeForm.getChild(UIFormInputIconSelector.class);
if (uiIconSelector.getSelectedIcon().equals("Default"))
pageNode.setIcon(null);
else
pageNode.setIcon(uiIconSelector.getSelectedIcon());
if (pageNode.getLabel() == null)
pageNode.setLabel(pageNode.getName());
Object selectedParent = uiPageNodeForm.getSelectedParent();
PageNavigation pageNav = null;
if (selectedParent instanceof PageNavigation)
{
pageNav = (PageNavigation)selectedParent;
pageNode.setUri(pageNode.getName());
if (!pageNav.getNodes().contains(pageNode))
{
if (PageNavigationUtils.searchPageNodeByUri(pageNav, pageNode.getUri()) != null)
{
uiPortalApp.addMessage(new ApplicationMessage("UIPageNodeForm.msg.SameName", null));
return;
}
pageNav.addNode(pageNode);
}
}
else if (selectedParent instanceof PageNode)
{
PageNode parentNode = (PageNode)selectedParent;
List<PageNode> children = parentNode.getChildren();
if (children == null)
{
children = new ArrayList<PageNode>();
parentNode.setChildren((ArrayList<PageNode>)children);
}
pageNode.setUri(parentNode.getUri() + "/" + pageNode.getName());
if (!children.contains(pageNode))
{
if (PageNavigationUtils.searchPageNodeByUri(parentNode, pageNode.getUri()) != null)
{
uiPortalApp.addMessage(new ApplicationMessage("UIPageNodeForm.msg.SameName", null));