3 Replies Latest reply on Apr 24, 2007 11:10 AM by fredf

    remove the drag and drop but keep portlet decoration

    fredf

      Hello

      In the developer forum I asked a question regarding drag and drop feature on portlets

      http://jboss.org/index.html?module=bb&op=viewtopic&t=105181

      but after the initial answer I had further questions.
      I guess I should address this user forum instead.

      I was told that I could set these constants

      PORTAL_PROP_WINDOW_RENDERER
      PORTAL_PROP_DECORATION_RENDERER
      PORTAL_PROP_PORTLET_RENDERER


      to the value emptyRenderer on an portal object to make the drag and drop disappear.


      But this removes the portlet frame images (decorations) for each portlet, right? I still want to have the portlet frames visible but just remove the ability to drag and drop them - or more correct, force the regions from letting their windows beeing moved from and to them.

      I have tracked down the functionality to this javascript line
      Code:

      <script>regions_on_page["regionA"]="left";</script>




      that is being set on each region in the layout. This script line enables the drag and drop to and from this region. Where is this line appended to the window and what would be the correct way to add the possibility to remove it with a parameter?


        • 1. Re: remove the drag and drop but keep portlet decoration

          no look at the property that inhibits ajax stuff which is "theme.ajax.object_enabled". If on a portal object you put this property with a value of "false" it should disable DnD for this part.

          you can set the property using the xml desc, it has not been redone yet in the new admin UI.

          • 2. Re: remove the drag and drop but keep portlet decoration
            fredf

             

            "julien@jboss.com" wrote:
            no look at the property that inhibits ajax stuff which is "theme.ajax.object_enabled". If on a portal object you put this property with a value of "false" it should disable DnD for this part.

            you can set the property using the xml desc, it has not been redone yet in the new admin UI.


            Ok, I missed that one.

            Now, I want to do this programmatically in my "portal service package" called from a SEAM component. I see that if I want to set it on a whole region I must get the region instance from PageRendition

            Region region = rendition.getPageResult().getRegion("myRegion");
            region.setProperty(ThemeConstants.PORTAL_AJAX_OBJECT_DISABLED, "true");
            


            Can I get hold of this region object without creating an interceptor (I see that the PageRendition comes from the cmd.invokeNext();)

            thanks


            • 3. Re: remove the drag and drop but keep portlet decoration
              fredf

              I found out that I have the region reference in the RegionTagHandler. Now I can write my own regiontag and provide the rendercontext with the ThemeConstants.PORTAL_AJAX_OBJECT_DISABLED to the renderer.

              The question is if

              region.setProperty(ThemeConstants.PORTAL_AJAX_OBJECT_DISABLED, "true");


              will write the property to the portal database or just be used in the particular page request. What happens if I set this property on a region. Will it be persisted or just used in the request?