Announcement

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

    Latest nightly build assertion error Canvas.getTopElement()

    SmartGWT 4.1d LGPL 2013-12-09 (also tried 2013-12-06)

    Previous versions of VLayout (and likely HLayout) did not have this assertion under getOrCreateRef:

    assert refInstance instanceof VLayout

    This is messing with an advanced use case, such as creating a Layout and assigning setScClassName later.
    I'm not saying that's a good idea - I wouldn't have done it that way but unfortunately I can't refactor it out in the near term which means we can't keep trying new builds until we do.

    Perhaps an assertion to Layout may still give you what you need?

    assert refInstance instanceof Layout

    Here's a test case. I tried to cut out all the extra junk - I believe this simplified code should blow up:

    Code:
    public class MyWidget extends Layout
    {
       public MyWidget()
       {
           Layout layout = new Layout();
           layout.setScClassName("VLayout");    //Yuck!!!  (someone created a base class that's used *everywhere* with an H vs V constructor that calls this method to assign CSS!
           addMember(layout);
           Canvas canvas = layout.getTopElement();
       }
    }
    java.lang.AssertionError: null
    at com.smartgwt.client.widgets.layout.VLayout.getOrCreateRef(VLayout.java:104)
    ....

    (invoked natively by Canvas.getByJSObject)
    Last edited by beckyo; 9 Dec 2013, 12:03.

    #2
    Revise the assertion to Layout?

    Hi guys - the more I read up on setScClassName and skinning looks like what we're doing is OK, albeit an advanced thing. Could you change that assertion to Layout instead of H/V Layout?

    Thanks!
    -B

    Comment


      #3
      Hi guys hoping you will check this thread out!

      Comment


        #4
        Will you be able to change the assertion to Layout?

        Instead of VLayout or HLayout?
        Thanks,
        -B

        Comment


          #5
          Calling setSCClassName on Layout...

          Isomorphic team.

          If we have a Layout, and we call setSCClassName setting the CSS class to the H or V layout CSS, later the JS tries to assert that the class is H or V layout but it's still Layout.

          Any chance you can modify the assertion?

          Thanks!
          -B

          Comment

          Working...
          X