1 Reply Latest reply on May 22, 2008 2:51 AM by Pavel Myshkin

    Copying a window from page to page - not rendered

    Pavel Myshkin Newbie

      Hello,

      I am trying to copy a window from a page in the portal to the current navigation page and the window is not rendered after it addition.

      PortalObject object = JBPServiceLocator.getPortalObjectContainer().getObject(sourceWindowPortalObject);
       System.out.println("Trying to add " + object.getName());
       Window window = (Window) object;
       Page page = (Page) pagePortalObject;
      
       String regionName = "center-top-wide";
       String string = window.getName() + "xyz";
      
       PortalObject copy = window.copy(page, string, false);
       Window child = (Window) page.getChild(string);
       child.setDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION, regionName);
      
       for(Object obj : page.getChildren()){
       if(obj instanceof Window){
       Window po = (Window) obj;
       System.out.println("po " + po.getName());
       }
       }
      
      I am sure that the layout of the page has the region that is assigned to the new window.
      
      After the copy the new window appears as a child of the page.
      
      Is there anything else that I need to do to get the window to render?
      
      Thank you