6 Replies Latest reply on Mar 16, 2009 1:08 AM by peris

    Remove portlet Maximize button.

      Jboss server 4.2.2.GA
      Jboss portal 2.7.0

      I have to remove all portlets maximize button. Please guide me to do this.

        • 1. Re: Remove portlet Maximize button.
          fuchs

          One alternative ist to turn off the render mode (emptyRenderer).

          <window>
           <window-name>PortletWindow</window-name>
           <instance-ref>PortletInstance</instance-ref>
           <region>left</region>
           <height>1</height>
           <properties>
           <!-- turn the decoration off for this portlet (i.e. no title and mode/state links) -->
           <property>
           <name>theme.decorationRendererId</name>
           <value>emptyRenderer</value>
           </property>
           </properties>
           </window>
          


          • 2. Re: Remove portlet Maximize button.

            Thanks Fuchs. If I set emptyRenderer, we cant see the other link(minimize). I want to remove only maximize button .

            • 3. Re: Remove portlet Maximize button.

              One technique we've used in the past to do what you're describing is somewhat similar to fuchs recommendation.

              We extended our custom decoration renderers to look for a window property to disable certain mode/state links.

              Example property:

              <property>
               <name>maximized.windowstate.decoration.render</name>
               <value>false</value>
              </property>


              And then your decoration renderer code would look something like:

              if (drc.getProperty(action.getName() + "." + actionKey + ".decoration.render") != null) {
               render = Boolean.valueOf(drc.getProperty(action.getName() + "." + actionKey+ ".decoration.render"));
              }
              if (render) {
               //print out link markup
              }


              • 4. Re: Remove portlet Maximize button.
                fuchs

                Iam not sure, because dont use any modes. But a other solution could be to overwrite the css.

                .portlet-mode-maximized {
                 overflow: hidden;
                }
                


                Maybe with hidden or nothing.

                • 5. Re: Remove portlet Maximize button.

                  I don't think you'd want to set overflow, you'd want to set either visibility, display, or use positioning to push the element off the screen:

                  display:none;
                  visibility:hidden;
                  position:absolute;left:-9999em;


                  This solution would still render the links in the markup, but use CSS to hide or move them for *all* portlets.

                  I'd recommend extending your DecorationRenderer to support your needs as mentioned previously.

                  • 6. Re: Remove portlet Maximize button.

                    Thankyou apemberton and Fuchs.
                    I have set the following code in css.


                    visibility:hidden;
                    position:absolute;left:-9999em;

                    It is working fine.