Announcement

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

    Browser size (Height and Width) is not changing automatically

    Hi,

    I have a issue like below.

    I have smart gwt application with 30+ pages in different sizes with header and footer.

    header and footer is the 1st and 3rd member in the VLayout. The 2nd member is menu obj, the value is changing as user selects the tab.

    Issue Ex:

    Step1 : Initially home page load i dont see any browser horizontal or vertical scrolls.
    Step2 : I accessed one page in the menu. The page height and width is more than the scree/browser window size. so i got both browser horizontal and vertical scrolls.
    Step3 : Again come back to the home page, whose size is exactly equal to the scree/browser window size. But still here i am able to see both browser horizontal and vertical scrolls. During horizontal or vertical scroll, i was able to see empty space/gaps on the browser. These gaps i am not able to select user IE browser development console (F12).

    Expecting results : Browser size (Height and Width) should change according to the requested page size. horizontal and vertical scrolls should appear if the size of the tab is exists the size of the screen/browser window.

    Here is the example code. Only the change is happing for menu object whenever new tab/menu selected.

    VLayout mainLayout = new VLayout();
    mainLayout.setWidth100();
    mainLayout.setHeight100();
    mainLayout.addMember(header);
    mainLayout.addMember(menu);
    mainLayout.addMember(footer);
    mainLayout.draw();



    Attached images shows the information of Step1, 2, 3.

    Appreciate any one earlier help.

    Thanks,
    Hari.
    Attached Files

    #2
    If you have content which is hidden the browser will still show scrollbars for it.

    There are a lot of different approaches for avoiding this, two are:

    1. turn off browser scrolling (add overflow:hidden to CSS for <body> element) and enable scrolling for your outermost SmartGWT widget (set overflow to auto). Our containers are specialized so that they don't have the weird behavior of allowing scrolling to hidden content

    2. clear() widgets instead of just hiding them. This destroys their DOM, which can be re-created by having them draw() again. This is much slower than a hide()/show(), but it also cleans up unused DOM elements, so it can be the right thing to do for a hidden screen that isn't likely to be shown again soon.

    Comment


      #3
      Hi Isomorphic,

      Thanks for your earlier reply.

      For 1st approach : I had already tried with 1st approach and i got solution but as per my requirement, i need only browser scrolls. Not the smart gwt outermost element scrolls.

      For 2st approach : During Menu/Tab/Widget change i am not hiding the old or previously selected widget. i am calling the destroy function to destroy the old widget, like below

      Canvas oldPane = tab.getPane();
      oldPane.destroy();

      I had tried with clear() also.

      But still same issue with browser height and width for unused space.

      Any other solution to deal with this issue?

      Comment


        #4
        As far as approach #2, if there is still scrolling, you have not successfully destroyed the hidden content. Use the Watch tab to figure out what widgets still extend outside the browser viewport - click the checkboxes for "hidden" and "undrawn" to make sure you are seeing all widgets.

        Comment


          #5
          I had tried with Watch tab also before my post.

          In Watch tab control, i was able to select the header, body and footer. But was not able to select the unused space below to the footer.My preferred browser is IE8. My development node have IE9. Same problem is there in both browser consoles.

          But in IE watch tab if i select the <html> tag, the whole page including the unused space is selecting. But can able to select the unused space alone.

          Comment


            #6
            You would not expect to be able to select the unused space alone, but rather some widget which extends into the unused space.

            Remember to check the boxes for "undrawn" and "hidden" to ensure you're seeing everything.

            Also note that any HTML elements you've directly created (not through SmartGWT) could also be at fault, as well as any elements created by any third party widgets you may be using.

            Finally, if you suspect for whatever reason the fault lies in SmartGWT, we'll need a ready-to-run test case that reproduces the issue.

            Comment


              #7
              Hi,

              i had tried all the possibilities....but no luck.

              For ready-to-run test case....

              You might have the smart get application right.
              Use the browser scroll bars than smart gwt outer most component scroll bars.

              Run the application in IE 8/9 browser.

              First access the small page/screen which has small width and height. For this page you won't get the browser horizontal and vertical scroll bars. This is expected here.

              Now access the bigger/large page/screen which has more width and height. Now you will get the browser horizontal and vertical scroll bars. This is expected here.

              Now access small page/screen or go back to the old screen. Here you should not see the browser horizontal and vertical scroll bars. Because the page size is less....But in my case still appears.

              Can you try the above case with your smart gwt application.

              My code confidential so i can't share the ready to run test cases.

              Thanks,
              Hari.

              Comment


                #8
                We constantly do this with a wide variety of applications and do not have persistent scrollbars.

                To investigate further, we need ready-to-run code that reproduces the issue. It doesn't have to be your actual application code.

                Comment


                  #9
                  Hi,

                  Here is the steps to reproduce.

                  Run the application in IE 8/9 browser.

                  1. First access the small page/screen which has small width and height. For this page you won't get the browser horizontal and vertical scroll bars. This is expected here.

                  2. Now access the bigger/large page/screen which has more width and height. Now you will get the browser horizontal and vertical scroll bars. This is expected here.

                  3. Now access small page/screen or go back to the old screen. Here you should not see the browser horizontal and vertical scroll bars. Because the page size is less....But in my case still appears.

                  Can you try the above case with your smart gwt application.

                  i have attached the images and ready to tun java files...

                  I had copied 2 java files into this txt file 2_listgrid_java_files...bcz forum has max 5 files limit to upload.

                  Can you try and check is this issues happing in your end or not.

                  Thanks,
                  Hari.
                  Attached Files

                  Comment


                    #10
                    There's a reason the forums has upload limits - test cases should be minimal. Can you please get rid of all the unrelated code you've posted and make a minimal test case? Then we can look at it as a possible framework bug.

                    Comment


                      #11
                      Hi,

                      Test cases should be minimal....What is the minimal test case?

                      Can you please get rid of all the unrelated code you've posted and make a minimal test case? ------ As per me i don't see any un related code. But for you again i cleaned.Attached files is the latest files for 2 list grid widgets. There might be the common code in 2 files.To test the screen/page height that required.


                      Thanks,
                      Hari.
                      Attached Files

                      Comment


                        #12
                        Hi,

                        Here is the minimal test cases. i had removed all unrelated code.

                        I am using smartgwtee-3.0p version.

                        3_java_widget_files.txt file have 3 java (AcmeDemo.java, SmallerListingWidget.java, BiggerListingWidget.java) file's code.

                        Please place the web.xml, AcmeDemo.html, AcmeDemo.gwt and
                        java files in the project hierarchy. i am not able to upload my project folder structure zip file. Bcz file is not a valid one to upload.

                        Below is my project folder structure (just for reference).

                        AcmeDemo\src\com\gwt
                        This package has AcmeDemo.gwt file
                        AcmeDemo\src\com\gwt\client
                        This package has all java file
                        AcmeDemo\war
                        This package has AcmeDemo.html file
                        AcmeDemo\war\WEB-INF
                        This package has web.xml file

                        I had attached all files.

                        Steps to reproduce the issue:
                        1. When you run the application in IE. You will see the first tab "Smaller Listing - 10 Records" which has 10 records and fits to the screen. No browser scrolls.
                        2. Now access the second tab "Bigger Listing - 100 Records" which has 100 records. You can see the browser vertical scroll also.
                        3. Come back or access the first tab, browser vertical scroll still available here.When you scroll down you will see the lot of black space.



                        Thanks,
                        Hari.
                        Attached Files

                        Comment


                          #13
                          Remove setOverflow(visible) on the TabSet to correct your code.

                          Comment


                            #14
                            Hi,

                            I had made the suggested change. But the behavior is not right solution.
                            Please find the attached images to see the impact after the change.

                            When i opened the "Bigger Listing - 100 Records" which has more records. Here also browser scroll is not appearing. But component vertical scroll appeared. When i move down the page/list grid using component vertical scroll it goes disappear.

                            With this change if i have header and footer in my application, footer wont visible for larger pages/widgets.

                            I am expecting the result like when coming back to the small pages from large one, browser also should change the height and width according to the page/widget height and width.

                            The present change is like always browser scroll won't visible and i am not able to see the end records also.This is not the expected result as per my requirement.

                            Any suggestion to change the browser height and width according to the page/widget height and width change.


                            Thanks,
                            Hari.
                            Attached Files

                            Comment


                              #15
                              As we covered initially: your options are to use the SmartGWT scrolling system (which ignores content considered hidden), or, you must clear() any widget that becomes hidden yet extends out of the browser viewport. We recommend the former; your code is still not using either of the strategies that we've told you will work.

                              Comment

                              Working...
                              X