Announcement

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

    Layout Group Title Position Changes When Updated

    Hi Isomorphic,

    When we attempt to update the Group Title for a VLayout, the positioning changes on us.

    com.smartgwt.client.widgets.Canvas.setGroupTitle(String)


    Chrome Before Group Title Update
    Click image for larger version

Name:	chrome_before.png
Views:	205
Size:	390 Bytes
ID:	262539

    Chrome After Group Title Update
    Click image for larger version

Name:	chrome_after.png
Views:	183
Size:	387 Bytes
ID:	262540


    Firefox Before Group Title Update
    Click image for larger version

Name:	firefox_before.png
Views:	182
Size:	398 Bytes
ID:	262541


    Firefox After Group Title Update
    Click image for larger version

Name:	firefox_after.png
Views:	179
Size:	404 Bytes
ID:	262542


    SmartClient Version: v12.0p_2020-04-03/Pro Deployment (built 2020-04-03)

    Thanks

    #2
    We've looked into this and we see the problem in 12.0 and 12.1.

    A change had already been made shortly after your build-date that should make things work properly in FireFox.

    For Chrome and Opera, we'll update here when we have a solution. In the meantime, can you confirm whether you see an error in the browser console after a call to setGroupTitle() misbehaves?

    Comment


      #3
      Hi Isomorphic,

      Yes, there is a console error.

      *10:53:08.283:XRP8:WARN:drawing:isc_xxxxxLayout_29_groupLabel:Attempt to draw child of an undrawn parent - ignoring

      Regards
      Last edited by stonebranch2; 29 May 2020, 07:04.

      Comment


        #4
        Please retest with a more recent build - there were two recent fixes to groupTitle placement and those fixes were backported to 12.x, but that happened a few days after your current build.

        Note that the console error we noted seeing above was actually a stack-trace generation error, much more obvious than the warning you saw, and it's specific to Chrome. That's already fixed in our development branch and will be ported back to 12.0 shortly.

        Please let us know if you still see issues with a build from the last few days - we may need to see a short sample.

        Comment


          #5
          Hi Isomorphic,

          We are still seeing this behavior in the following build.

          SmartClient Version: v12.0p_2020-08-08/Pro Deployment (built 2020-08-08)

          Click image for larger version

Name:	Firefox_Defaults.png
Views:	148
Size:	8.4 KB
ID:	263345

          Click image for larger version

Name:	Chrome_Defaults.png
Views:	138
Size:	5.0 KB
ID:	263346

          Thanks
          Attached Files
          Last edited by stonebranch2; 12 Aug 2020, 11:19.

          Comment


            #6
            We just tested this again, with the latest 12.0, and we still see no problems in any browser, including the warning you noted.

            So, we're going to need to see a runnable test-case that shows the problem. Our test-case is below, but there must be something extra at play in your case, perhaps you're installing margin/padding in some way, or the layout is in a non-visible tab, for example. Please also confirm your OS/browser version and skin (we tested with Enterprise and Tahoe, Windows 10, all browsers).

            Here's the test-case we used
            Code:
                    VLayout layout = new VLayout();
                    layout.setTop(50);
                    layout.setWidth(500);
                    layout.setHeight(500);
                    layout.setIsGroup(true);
                    layout.setGroupTitle("A Title");
            
                    // works with or without members in the layout, but add one here
                    Canvas canvas = new Canvas();
                    canvas.setWidth100();
                    canvas.setHeight100();
                    canvas.setBackgroundColor("lightgreen");
                    layout.addMember(canvas);
            
                    // works whether your draw() here, or after calling setGroupTitle() below - no logs produced
                    //layout.draw();
            
                    IButton button = new IButton("Update Group TItle");
                    button.setAutoFit(true);
                    button.addClickHandler(new ClickHandler() {
                        @Override
                        public void onClick(ClickEvent event) {
                            layout.setGroupTitle("New Group Title");
                            layout.draw();
                        }
                    });
                    button.draw();
            Last edited by Isomorphic; 18 Aug 2020, 05:37.

            Comment


              #7
              Hi Isomorphic,

              Thank you.

              By adding the check to not set the group title if !layout.isDrawn(), that seems to have eliminated our problem. It seems we had a scenario where we were setting the group title at some point after creating it and before it was fully drawn.

              Regards
              Last edited by stonebranch2; 27 Aug 2020, 08:59.

              Comment

              Working...
              X