Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-6214

Provide the current width of a portlet as a variable to a plug-in that provides a portlet

    Details

    • Similar Issues:

      Description

      The analysis plug-ins provides several portlets with user configurable width and height. Since the width of a portlet depends on the screen resolution and the number of columns it would be nice if the default width for a portlet graph would be available as a variable in the jelly scripts (at least a default width for single or double column display would be nice).

      (The same would be good for the height, too. Here at least a default height would be nice to have.)

        Attachments

          Activity

          Hide
          drulli Ulli Hafner added a comment -

          Yes, I mean the width of the frame. Couldn't that be done with some javascript?

          Maybe the width of a portlet should be kind of 'auto-resizable', i.e. if the user changes the size of the frame (e.g., by shrinking the browser window), then the portlet automatically fills the available space. I don't know if that is possible, maybe someone on the dev list knows how to do that?

          Show
          drulli Ulli Hafner added a comment - Yes, I mean the width of the frame. Couldn't that be done with some javascript? Maybe the width of a portlet should be kind of 'auto-resizable', i.e. if the user changes the size of the frame (e.g., by shrinking the browser window), then the portlet automatically fills the available space. I don't know if that is possible, maybe someone on the dev list knows how to do that?
          Hide
          mambu Marco Ambu added a comment -

          Do you mean that when a portlet is displayed it gets the width of the 'frame' which it is going to be shown in?
          I don't know how to get this value (in pixels) because in the dashboard it is expressed in percentage (50% for 2 columns, 100% for 1 columns).

          Show
          mambu Marco Ambu added a comment - Do you mean that when a portlet is displayed it gets the width of the 'frame' which it is going to be shown in? I don't know how to get this value (in pixels) because in the dashboard it is expressed in percentage (50% for 2 columns, 100% for 1 columns).
          Hide
          drulli Ulli Hafner added a comment -

          Updated the description since it was misleading. The width and height already is configurable, what is missing are defaults for width and height.

          Show
          drulli Ulli Hafner added a comment - Updated the description since it was misleading. The width and height already is configurable, what is missing are defaults for width and height.
          Hide
          mambu Marco Ambu added a comment -

          Please use graphWidth and graphHeight as variable names for the 'graph', anyway do not use width and height, because looking at the several issues for the dashboard-view plugin maybe we will insert width (and height???) as the dimension of the portlet (the entire portlet, not only the graph inside). So we can avoid conflicts later. Thanks.

          Show
          mambu Marco Ambu added a comment - Please use graphWidth and graphHeight as variable names for the 'graph', anyway do not use width and height, because looking at the several issues for the dashboard-view plugin maybe we will insert width (and height???) as the dimension of the portlet (the entire portlet, not only the graph inside). So we can avoid conflicts later. Thanks.
          Hide
          mambu Marco Ambu added a comment -

          To add some extra parameters to your DashboardPortlet you need to implement your own config.jelly (you can make a copy of one config.jelly in the dashboard-view plugin source code).
          Then add your parameters to you ctor and that's it.
          See issue 6811 and dashboard-view wiki (I have just updated it with the instructions).

          Show
          mambu Marco Ambu added a comment - To add some extra parameters to your DashboardPortlet you need to implement your own config.jelly (you can make a copy of one config.jelly in the dashboard-view plugin source code). Then add your parameters to you ctor and that's it. See issue 6811 and dashboard-view wiki (I have just updated it with the instructions).

            People

            • Assignee:
              petehayes Peter Hayes
              Reporter:
              drulli Ulli Hafner
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: