Announcement

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

    ListGrid scrollbars gone crazy

    Hey all,

    Im runing into some strange issue in a SmartGWT based Liferay Portlet application.

    My listgrids are getting this behavior once the page loads. Note that this is hapening only once my application is deployed (in DevMode, everything is OK).

    Could this be a CSS problem ?

    The problem already existed in SmartGWT 2.4, but since I went to 2.5, the scrollbars are blinking. In addition to that, when the list grid is drawn, it always have his scrollbars shown.

    Here's the behavior : http://www.jmichelgarcia.com/GWT/ListGrid.avi (save as)

    Developper Console says :

    13:38:16.357:RDQ5:INFO:scrolling:isc_OperationList_0_body:Drawn size: 322 by 642, specified: 338 by 658, scrollbar state:
    13:38:16.358:RDQ5:INFO:scrolling:isc_OperationList_0_body:Scrollbar state: VH ->
    13:38:16.370:RDQ5:DEBUG:scrolling:isc_OperationList_0_body:scrollTo(0, null), reason: ending hscroll
    13:38:16.371:RDQ5:DEBUG:scrolling:isc_OperationList_0_body:scrollTo(null, 0), reason: ending vscroll
    13:38:16.378:RDQ5:INFO:scrolling:isc_SimpleEntitiesTable_0_body:Drawn size: 436 by 658, specified: 436 by 658, scrollbar state: hv
    13:38:16.378:RDQ5:INFO:scrolling:isc_SimpleEntitiesTable_0_body:Scrollbar state: -> VH
    13:38:16.399:RDQ5:INFO:scrolling:isc_SimpleEntitiesTable_0_body:Drawn size: 420 by 642, specified: 436 by 658, scrollbar state:
    13:38:16.400:RDQ5:INFO:scrolling:isc_SimpleEntitiesTable_0_body:Scrollbar state: VH ->
    13:38:16.412:RDQ5:DEBUG:scrolling:isc_SimpleEntitiesTable_0_body:scrollTo(0, null), reason: ending hscroll
    13:38:16.412:RDQ5:DEBUG:scrolling:isc_SimpleEntitiesTable_0_body:scrollTo(null, 0), reason: ending vscroll

    +

    13:39:41.531:RDQ6:DEBUG:layout:isc_SimpleEntitiesTable_0:new field widths: 210,210
    13:39:41.552:RDQ6:DEBUG:layout:isc_SimpleEntitiesTable_0:new field widths: 210,210
    13:39:41.609:RDQ0:DEBUG:layout:isc_OperationList_0:new field widths: 107,107,108
    13:39:41.630:RDQ0:DEBUG:layout:isc_SimpleEntitiesTable_0:new field widths: 210,210
    13:39:41.652:RDQ0:DEBUG:layout:isc_OperationList_0:new field widths: 107,107,108
    13:39:41.673:RDQ0:DEBUG:layout:isc_SimpleEntitiesTable_0:new field widths: 210,210
    13:39:41.689:RDQ0:DEBUG:layout:isc_SimpleEntitiesTable_0:new field widths: 210,210

    Thanks a lot,

    Have a nice day.

    Cheers.

    FF 5.0, GWT 2.3, SmartGWT 2.4, Windows XP
    Last edited by jmichelgarcia; 27 Sep 2011, 03:50.

    #2
    Yes, it's probably CSS or inline styling in content. What's happening is that the browser is reporting that the content is large enough that scrollbars will be required, then SmartGWT shrinks the content area to add scrollbars, then the browser reports that the content is no longer long enough to require scrollbars. Basically a browser bug.

    Unlikely to be a difference between 2.4 and 2.5 so look for differences in the contained content instead, including differences in CSS styles applied.

    Comment


      #3
      Thank you for your help.

      I will try to check for CSS being applied, and try to override those properties. (Since i can't change Liferay's CSS).

      Comment


        #4
        I managed to resolve the blinking issue simplifying the layouts managers.

        But my ListGrid, still always show theirs scrollbars.

        I've put in attachment, a screenshot of the ListGrid once the page loads. Then, when I click on the scrollbar and move it, the scrollbars disappears.

        The problem still happens in FF 7.

        Initially I though that the problem was with the ScrollBar gap, and even removing it, the visual bug persists.

        I will take a deeper look into CSS now.

        Is there any workaround for this ?

        ----------
        PROBLEM PARTIALLY SOLVED

        After a couple of hours searching I managed to solve the problem.

        Initially, I had this :

        - VLayout
        \-- HLayout
        \-- ListGrid
        \-- HLayout

        and having the problem stated before, I changed to :

        - VLayout
        \-- HLayout
        \-- HLayout
        \----\ ListGrid
        \-- HLayout

        Inserting the ListGrid into a surrounding VLayout solved the problem.
        Attached Files
        Last edited by jmichelgarcia; 28 Sep 2011, 06:20.

        Comment


          #5
          In fact, doing that solve the visual problem, but now my application is using 50% of the CPU, and resulting in a growing firefox used memory problem.

          Once all my portlets are embedded into Liferay, it seems that some CSS from the Liferay theme are messing with the SmartGWT "perfect pixel" system.

          Im having the same problem with : ListGrid and Trees.

          This resulting in a gorgeous number of redraws and causing my app to freeze.

          Any solution ? help ? clues ?

          Im getting crazy.

          Please advise me.

          Comment


            #6
            Again, its some kind of bad CSS from Liferay, probably a poor practice such as applying padding to all tables elements regardless of whether they are rendered by Liferay itself or a portlet. Isolate the problematic CSS (Firebug can help here), then you'll be able to compensate for it.

            Comment


              #7
              Hi Isomorphic,

              So, after some digg, here's an example of the problem im facing.

              In the classic Liferay theme, I have some css definitions like that :

              input[text] { padding: 0px; }

              which it's conflicting with Smart GWT rules like

              .textItem { padding: 2px; }

              I have many ex like thay cause my portlet not to be perfectly showing.
              So, I cannot change the Liferay CSS (not managed by me). I was willing to add !important to all css SmartGWT rules, because is the only solution I see.

              Do you thing is a good approach? Can I manage to do this automatically?

              I do really appreciate your help on this, it's driving me crazy !

              Cheers

              Comment


                #8
                That's what we suspected, and it's bad practice generally, but it's spectacularly bad practice for a portal, as it affects all HTML rendered by anything in the portal. If you haven't yet, we'd recommend looking to see if there is Liferay bug filed for this with a workaround. If not, yes, marking our rules !important would be a workaround.

                Comment


                  #9
                  So,

                  I've managed to add !important to all SmartGWT css rules using a Maven plugin.

                  Has if I have a choice, I can't give up on trying lol.

                  So, still some glitches.

                  Here's some screens in attachments. In red, you can see Liferay's CSS still appearing lol.

                  Here's the bug/improvment report : http://issues.liferay.com/browse/LPS-21775

                  PLEASE ADVISE
                  Attached Files
                  Last edited by jmichelgarcia; 4 Oct 2011, 05:59.

                  Comment


                    #10
                    Liferay includes CSS that sets border-collapse and border-spacing for all <table> elements? That's... what's a word stronger than spectacular?

                    The only way around this would be to reverse this setting on all SGWT-generated <table> elements - you could do this with a CSS rule that you apply to your outermost SGWT widget that affects all <table> elements found within that element.

                    However, we noticed that what you've done is filed a new bug with Liferay for this problem - what we actually meant to suggest was to look for an *existing* bug against Liferay for this issue. Many, many different frameworks would show visual glitches when CSS is used to change the default behaviors of HTML elements, so this bug has probably been filed before, and there may be a workaround provided.

                    Comment


                      #11
                      I will follow your advise concerning the CSS rule, and I will take a better look against already reported issues.

                      Im perhaps missunderstanding Liferay way of working here.

                      I'll digg !

                      Big thanks

                      Comment


                        #12
                        Hey Isomorphic team,

                        Seems that not everyone has good CSS practises, here's a answer in Liferay's forum.

                        "No, from the browser perspective it gets a bunch of css to apply to the page and has no idea that there are separate portlets on the page.

                        I've had similar issues w/ creating Vaadin portlets. The Vaadin widget set has it's own theme but, when used within a portlet, sometimes does not render correctly because the Vaadin theme expects it is the only CSS styling the Vaadin widgets.

                        The solution is to undo the Liferay standard CSS stuff in your specific classes. For example, if your <ul> object is given a class "my-treeview", you'd have the extjs class stuff in there, but you'd probably also have things to disable the margin and padding stuff that LR normally applies.

                        I found that the web developer toolbar in Firefox is useful to identify all the CSS stuff applied to a given element so you can see the kinds of things you'll need to undo in your specific class"

                        by David H Nebinger

                        Comment


                          #13
                          Not sure what you mean by "seems that not everyone has good CSS practises" - what this person on the forums is saying is that Liferay's poor CSS practices affect multiple frameworks (Vaadin, Ext, others) - exactly what we said. It's Liferay at fault in all of these cases.

                          And the suggested workaround is exactly what we've suggested to you - use extra CSS to explicitly reverse Liferay's damaging CSS settings. It's unfortunate that there is not yet an official fix from Liferay.

                          Comment


                            #14
                            Originally posted by Isomorphic
                            Not sure what you mean by "seems that not everyone has good CSS practises" - what this person on the forums is saying is that Liferay's poor CSS practices affect multiple frameworks (Vaadin, Ext, others) - exactly what we said. It's Liferay at fault in all of these cases.

                            And the suggested workaround is exactly what we've suggested to you - use extra CSS to explicitly reverse Liferay's damaging CSS settings. It's unfortunate that there is not yet an official fix from Liferay.
                            What im saying, is that Liferay could also use a better CSS approach. Like you guys do.

                            Thanks for everything.

                            I still plan to do a huge Tutorial on this, as soon as I will finish it.

                            Cheers.

                            Comment


                              #15
                              Ah good, glad we're clear. And we look forward to the tutorial!

                              Comment

                              Working...
                              X