Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Portal and Portlet Height

    Good evening,
    Looking at the code in SimplePortalSample, these lines caught my attention:
    Code:
                // these settings enable the portlet to autosize its height only
                // to fit its contents
                // (since width is determined from the containing layout, not
                // the portlet contents)
                setVPolicy(LayoutPolicy.NONE);
                setOverflow(Overflow.VISIBLE);
    As far as I can understand, it means that a portlet width is determined by its container, while its height depends on its conent. Right?
    Assuming that, I tried to add some canvas with a fixed height, but it won't work as intented (at least for me :-)).
    For example, I simply added this line:
    Code:
    label.setHeight(600);
    in the onClick method in addPortlet.addClickHandler, resulting in a portlet with a scrollbar, while I was expecting a portlet with increased height.
    Any suggestions?

    Thank you in advance...

    #2
    Bumping it up, hoping someone will notice...

    Comment


      #3
      Any news about it? We managed to fix the problem (it's not smooth as it should be) by playing around with Window's properties and adding a custom resize handler. But any suggestion, even a small hint, would be very appreciated.
      Thank you very much...

      Comment


        #4
        See the docs for overflow, and look at the hierarchy of widgets in the Watch tab of the Developer Console, and it should become more clear what's happening. Different widgets are autosizing or scrolling according to their overflow and size settings.

        Comment


          #5
          Thank you, I'll look into that.

          Comment


            #6
            The problem is I can't find a way to force a Window to respect hPolicy = 'fill' and vPolicy = 'none'. In addition, windowBody overflow is always set to auto, and when the content is taller than Window default height, then a scrollbar appears.

            I tried to use a simple Layout as a "portlet", setting vPolicy = 'none', hPolciy = 'fill' and overflow = 'visible', and everything seems to work fine. So i guess the problem may lie in Window implementation (I read the code and found that hpolicy and vpolicy are changed sometimes, i.e in the autosize method, but right now I don't have time to further investigate). It seems that writing our simpler version of Window would be the only way to go...

            Comment


              #7
              Window has an autoSize mode too - you've mentioned seeing the code for that but not whether you tried it. Window's autoSize mode should behave similarly to what you'd get from using a Layout as a portlet (which is not a bad approach either).

              Comment


                #8
                No, I tried setting autosize = true but, as a consequence, hPolicy is set to none (so the portlet are not resized when moved from a column to another)...

                Comment


                  #9
                  Ah ok. Autosizing is automatically turned off the first time something external assigns a size to a Window. But you can re-enable it by calling setAutoSize(true). We would expect this cause it to auto-size to the new width if called immediately before the portlet is dropped into it's new column.

                  Comment


                    #10
                    Is there a way (out of the box) to allow portlets to be resized like a window? Additionally, can portlets be laid out so that one/some are larger than others?

                    Comment


                      #11
                      Are you having trouble with the usual setCanDragResize() setting, or do you want a behavior that's different from this setting?

                      Comment

                      Working...
                      X