1. #1
    Ext User
    Join Date
    Apr 2008
    Posts
    11
    Vote Rating
    0
    paulwang is on a distinguished road

      0  

    Default HTMLTable getWidget/setWidget and ExtGWT Component

    HTMLTable getWidget/setWidget and ExtGWT Component


    Hi,

    I noticed that HTMLTable getWidget(int row, int column) always return null when the widget is a Ext GWT Component.

    Looking at the code it looks like HTMLTable is relying on getWidgetIndex(Element elem) to return the __widgetID attribute of the elem for it to find the widget in widgetMap.

    The problem occurs because Ext GWT Component getElement() method returns a dummy div when it's not rendered. It looks like the __widgetID is set on the dummy div but when you do a getWidget on HTMLTable it can't find the right widget since __widgetID is not set on the swapped in element.

    Code:
            final FlexTable foo = new FlexTable();
    
            final LayoutContainer bar = new LayoutContainer();
            bar.add(new HTML("<h1>HERE</h1>"));
    
    
            RootPanel.get().add(foo);
    
            foo.setWidget(0, 0, bar);
            foo.setWidget(1, 1, new HTML("<h2>THERE</h2>"));
    
            System.out.println(foo.getWidget(0, 0)); /* this is null but shouldn't be */
            System.out.println(foo.getWidget(1, 1));

  2. #2
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,239
    Vote Rating
    0
    darrellmeyer is on a distinguished road

      0  

    Default


    Thanks for looking into the problem. I have changed the code in Component to grab and set the widget id from the dummy element. I also changed getElement to only create the dummy element once, not every call to getElement. The test code now works, changes are in SVN.

  3. #3
    Ext User
    Join Date
    Sep 2008
    Location
    Salt Lake City
    Posts
    4
    Vote Rating
    0
    idajali is on a distinguished road

      0  

    Default GWT 1.6

    GWT 1.6


    Looks like they've changed it from "__widgetID" to "__uiObjectID" in GWT 1.6. Apparently they had two different ElementMapperImpl classes and they combined them (see http://www.mail-archive.com/google-w.../msg03129.html ).

    Consequently, this bug has now been reintroduced in GXT 2.0 (running on GWT 1.6).

  4. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,753
    Vote Rating
    113
    sven is just really nice sven is just really nice sven is just really nice sven is just really nice sven is just really nice

      0  

    Default


    Changed in SVN