Announcement

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

    [SmartGWT4] BaseWidget no longer assigning id when created

    Hello,

    I have encountered a change to BaseWidget which breaks some flows in our code, given its nature I can imagine that it will cause some havoc in other applications too.

    It seems that the id property is no longer set when the widget is created, but only upon first request.
    This causes some breakage when the widget is put in a map for instance (since it uses the id property directly through the hashCode method) - in my case it was event handling that did not work because of this (since it uses a map with the source widgets as key).

    In SNAPSHOT_v9.0d_2013-03-03/Pro Deployment 2013-03-03

    Code:
        public BaseWidget() {
            /*empty*/
        }
    Before (3.1):
    Code:
        public BaseWidget() {        
            String id = SC.generateID(getClass().getName());
            setID(id);
        }
    I had this issue on a Canvas instance.

    Please advise on how to get by this.

    I have attempted added a temp hack to call the getID function in the constructor - but that failed (nullpointers etc).

    thanks
    jan
    Last edited by hin3x; 4 Mar 2013, 05:05.

    #2
    We needed to defer ID assignment to enable some new functionality related to AutoChildren.

    We've made a change so that hashcode() will now force an ID to be allocated - this should fix your use case, but let us know if you run into some other subtle backcompat issue with this.

    Comment


      #3
      Works like a charm, thanks!

      Comment

      Working...
      X