Announcement

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

    HTMLPane not resizing properly

    When I put HTMLPane with some content in Window and that window in Canvas, HTMLPane is not resized to fill the window.
    If Window is not in Canvas then HTMLPane is fully resized to match the window's size.

    Is there a way to resize HTMLPane to match Window size when Window is in Canvas?

    Code:
            VLayout screenLayout = new VLayout();
            RootPanel.get().add(screenLayout);
            
            screenLayout.setWidth100();
            screenLayout.setHeight100();
            screenLayout.setShowResizeBar(false);
            screenLayout.draw();
            
            Canvas canvasMain = new Canvas();
            canvasMain.setWidth100();
            canvasMain.setHeight100();
            canvasMain.setBackgroundColor("rgb(100,200,100)");
            screenLayout.addMember(canvasMain);
            
            Window window = new Window();
            window.setTitle("PDF");
            window.setWidth(500);
            window.setHeight(700);
            window.setCanDragReposition(true);
            window.setCanDragResize(true);
            window.setAnimateFadeTime(1000);
            window.setAnimateMinimize(true);
            window.setKeepInParentRect(true);
            window.setShowMaximizeButton(true);
            
            HTMLPane htmlPane = new HTMLPane();
            htmlPane.setWidth100();
            htmlPane.setHeight100();
            htmlPane.setContentsType(ContentsType.PAGE);
            htmlPane.setContentsURL("http://www.smartclient.com/releases/SmartGWT_Quick_Start_Guide.pdf");
            window.addItem(htmlPane);
            // If window is not in canvas - it works OK
            canvasMain.addChild(window);
            window.show();
    I'm using :
    SmartGWT 3.1p
    SmartClient Version: v8.3_2012-11-20/LGPL Development Only (built 2012-11-20)
    Chrome 27.0.1453.94 m

    #2
    We're not reproducing a problem with this code.
    Could you try the latest nightly build. If the problem persists, can you upload a screenshot along with a description of exactly is not behaving as expected

    Thanks
    Isomorphic Software

    Comment


      #3
      If I comment this line
      canvasMain.addChild(window);
      it works fine.

      Some screenshots are attached.

      Tryed it also with Firefox 21.0 and the result is the same.
      Attached Files

      Comment


        #4
        Hello zorani, we've already tried your code, and it did not reproduce an issue. You need to try the latest patched build - see smartclient.com/builds.

        Comment


          #5
          I tried it with :
          SmartClient Version: v8.3p_2013-05-28/LGPL Development Only (built 2013-05-28)
          Chrome 27.0.1453.94 m

          and the result is still the same - HTMLPane is not resized fully.

          What version did you use when trying this code?
          Last edited by zoranl; 28 May 2013, 23:25.

          Comment


            #6
            We tried a 3.1p build from a week ago.

            Please use these instructions to verify you've actually installed the new build correctly and your browser is actually loading the new code.

            Comment


              #7
              I tried all steps in suggested instructions and looked into all js files with Firebug and they have valid version (Version v8.3p_2013-05-28 (2013-05-28)) from last build.
              But unfortunately HTMLPane still looks the same as in submitted screenshot.

              Did you try it also with v8.3p_2013-05-28/LGPL Development Only (built 2013-05-28), or should I use some other build to test this?

              Or do you maybe use other versions of browser?

              Comment


                #8
                Just a quick note to let you know this is queued up to be looked at again. We'll let you know as soon as we have more information

                Thanks
                Isomorphic Software

                Comment


                  #9
                  We are now reproducing the problem.
                  It seems you can avoid this problem if, instead of calling
                  Code:
                  RootPanel.get().add(screenLayout);
                  you simply do
                  Code:
                  screenLayout.draw();
                  to draw the base layout. Can you see if that corrects the problem for you?

                  We are still investigating why this should have an effect, but this may give you a workaround.

                  Regards
                  Isomorphic Software

                  Comment


                    #10
                    A quick follow up to slightly clarify the situation here.
                    The correct approach for drawing top level SmartGWT components is via the draw() method, rather than using RootPanel.add(...);. This is the approach we document in the Quick Start Guide.

                    There are some subtle differences to the generated structure in the DOM when you use RootPanel.add() rather than draw(). In most cases this will have no effect on behavior, but there are occasional edge cases where things will behave inconsistently if you don't use draw().

                    We have marked this down for further investigation, but the correct solution here is to simply use the draw() method in your application code.
                    Of course, if the problem persists for you when using this method, let us know.

                    Regards
                    Isomorphic Software

                    Comment


                      #11
                      I tried your suggestion and it works for my test example.

                      But sadly this is not the case for our solution for customer. And what is even more frustrating, there we have no RootPanel.add that we could comment out.
                      And the code is complex and dynamic so I can not make a simple test case for it, but in the end there is only that Window with HTMLPane added to Canvas.

                      What our research showed is that it stopped working with latest Chrome 27 (with Chrome 26 there was no problem).

                      I know that we can "solve" it by using other Chrome version but if your investigation shows up something new, please let me know.
                      Thank you so far.

                      Regards,
                      Zoran

                      Comment


                        #12
                        Interesting that it was introduced by an upgrade of Chrome from 26 to 27 - this implies they may have introduced a subtle bug in their HTML sizing engine. Unfortunately these are notoriously difficult to troubleshoot, especially without a reproducible test case on our end!

                        One thing worth checking to start with: Does the application nest SmartGWT widgets inside plain GWT widgets?
                        This is a pattern we do our best to support but it's not the recommended approach except as a temporary solution for integrating with legacy code. Using this pattern gives us less control over and information about the ultimate page layout and there may be edge cases where you get unexpected rendering behaviors.

                        If this is the case, you may want to try to eliminate such nesting - potentially using SmartGWT components (VLayout, HLayout etc) to manage the layout of the page as a whole.

                        Other than that we unfortunately don't have much to go on without a way to reproduce the problem.

                        Comment

                        Working...
                        X