2 Replies Latest reply on Apr 18, 2009 6:04 AM by vivek_saini07

    How to set empty renders for portlets

      Jboss server 4.2.2.GA
      Jboss portal 2.7.0


      1 ) I have set empty render for portlets in admin side. How to set empty render programatically.

      2) Is it possible to prevent the drag and drop functionalities in left region only ?.

      Thanks in advance.

        • 1. Re: How to set empty renders for portlets

          We typically indicate the empty renderer in the page description file portal-object.xml. Not sure this approach will meet your needs.

          <window>
           <window-name>Intro</window-name>
           <instance-ref>introInstance</instance-ref>
           <region>top</region>
           <height>2</height>
           <properties>
           <property>
           <name>theme.renderSetId</name>
           <value>emptyRenderer</value>
           </property>
           </properties>
           </window>
          


          As for preventing drag & drop for windows within a specific region... we modified the dyna.js file to remove the drag & drop hooks for any window regions within an enclosing div which has a special class name we use to indicate the region shouldn't allow drag or drop activity. We add the special class name to a region in the layout JSP.

          Maybe others have a better solution?

          • 2. Re: How to set empty renders for portlets

             


            2) Is it possible to prevent the drag and drop functionalities in left region only ?.


            I achived this by modifying renderHeader of DynaRegionRenderer.java

            Region for which DnD to be disabled, region name will contain "NonDnD".

            if (options.isDnDEnabled())
             {
             List win =(List)rrc.getWindows();
             boolean isDnD=false;
             Iterator it=win.iterator();
             while(it.hasNext())
             {
            
             WindowContext po=(WindowContext)it.next();
             if(po.getRegionName().indexOf("NonDnD")==-1)
             {
             markup.print("<div class=\"dnd-region\" id=\"");
             markup.print(rrc.getId());
             markup.print("\">");
             }
             Map mapObj=po.getProperties();
            
            
            
            
             }
            // markup.print("<div class=\"dnd-region\" id=\"");
            // markup.print(rrc.getId());
            // markup.print("\">");
             }
             }
             else
             {
             delegate.renderHeader(rendererContext, rrc);
             }