Announcement

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

    ListGrid problems in IE

    SC 10-09-2012 8.2p, reproduceable in IE8,IE9


    We currently have this issue in production where getDisplayField is being called on a listgrid that WAS on the page prior to the action that we have just performed. We are working on getting a standalone testcase but in the meantime, I'd like to get your feed back on our findings. We put IE debugger on so that it breaks on exception and here's the stack of calls that we've found - We did not find a single call from our code in the stack so we've assumed that it is coming from internal SC code.

    Code:
    >             isc_ListGrid_getDisplayField
                   isc_ListGrid_getFieldDisplayType
                   isc_ListGrid__formatBooleanFieldAsImages
                   isc_ListGrid_showValueIconOnly
                   isc_ListGrid_getCellValue
                   anonymous
                   isc_GridRenderer__getCellValue
                   isc_GridRenderer_getTableHTML
                   isc_GridRenderer_getInnerHTML
                   isc_c_Class_invokeSuper
                   isc_c_Class_Super
                   isc_GridBody_getInnerHTML
                   isc_Canvas__getInnerHTML
                   isc_Canvas__updateInnerHTML
                   isc_c_Class_invokeSuper
                   isc_GridRenderer__updateInnerHTML
                   isc_Canvas__updateHTML
                   isc_Canvas_redraw
                   isc_c_Class_invokeSuper
                   isc_GridRenderer_redraw
                   isc_c_Class_invokeSuper
                   isc_GridBody_redraw
                   isc_Layout_resizeMembers
                   isc_Layout_layoutChildren
                   isc_ListGrid_layoutChildren
                   isc_Canvas__completeResizeBy
                   isc_Canvas_resizeBy
                   isc_Canvas_resizeTo
                   isc_Layout_resizeMembers
                   isc_Layout_layoutChildren
                   isc_Canvas__completeResizeBy
                   isc_Canvas_resizeBy
                   isc_Canvas_resizeTo
                   isc_Layout_resizeMembers
                   isc_Layout_layoutChildren
                   isc_Canvas__completeResizeBy
                   isc_Canvas_resizeBy
                   isc_Canvas_resizeTo
                   isc_Layout_resizeMembers
                   isc_Layout_layoutChildren
                   isc_Canvas__completeResizeBy
                   isc_Canvas_resizeBy
                   isc_Canvas_resizeTo
                   isc_Layout_resizeMembers
                   isc_Layout_layoutChildren
                   isc_Canvas__completeResizeBy
                   isc_Canvas_resizeBy
                   isc_Canvas_resizeTo
                   isc_Layout_resizeMembers
                   isc_Layout_layoutChildren
                   isc_Canvas__completeResizeBy
                   isc_Canvas_resizeBy
                   isc_Canvas_resizeTo
                   isc_Layout_resizeMembers
                   isc_Layout_layoutChildren
                   isc_Canvas__completeResizeBy
                   isc_Canvas_resizeBy
                   isc_Canvas_resizeTo
                   isc_Layout_resizeMembers
                   isc_Layout_layoutChildren
                   isc_Canvas__completeResizeBy
                   isc_Canvas_resizeBy
                   isc_Canvas_resizeTo
                   isc_Layout_resizeMembers
                   isc_Layout_layoutChildren
                   isc_Canvas__completeResizeBy
                   isc_Canvas_resizeBy
                   isc_Canvas_resizeTo
                   isc_Layout_resizeMembers
                   isc_Layout_layoutChildren
                   isc_Canvas__completeResizeBy
                   isc_Canvas_resizeBy
                   isc_Canvas_resizeTo
                   isc_Layout_resizeMembers
                   isc_Layout_layoutChildren
                   isc_Canvas__completeResizeBy
                   isc_Canvas_resizeBy
                   isc_Canvas_resizeTo
                   isc_Layout_resizeMembers
                   isc_Layout_layoutChildren
                   isc_Canvas__completeResizeBy
                   isc_Canvas_resizeBy
                   isc_Canvas_resizeTo
                   isc_Layout_resizeMembers
                   isc_Layout_layoutChildren
                   isc_Canvas__completeResizeBy
                   isc_Canvas_resizeBy
                   isc_Canvas_resizeTo
                   isc_Layout_resizeMembers
                   isc_Layout_layoutChildren
                   isc_Canvas__completeResizeBy
                   isc_Canvas_resizeBy
                   isc_Canvas_resizeTo
                   isc_Layout_resizeMembers
                   isc_Layout_layoutChildren
                   isc_Layout_reflowNow
                   Anonymous Function
                   isc_c_EventHandler_runTeas
                   isc_c_EventHandler__clearThread
                   isc_c_Timer__fireTimeout
                   anonymous

    Basically, the exception happens in getDisplayField where this.getDataSource() is returning a string representation of the data source and not the ds object itself. What's really troublesome is that the listgrid is no longer in view and therefore should not be updated for anything anymore. Any thoughts on how this could happen?


    Code:
    isc_ListGrid_getDisplayField(_1) {
                   var _2=_1.displayField;
                   if(_2!=null) {
                                  var _3=_1.optionDataSource?isc.DataSource.get(_1.optionDataSource):null;
                                  if(_3!=null)
                                                 _2=_3.getField(_2);
                                  else {
                                                 _2=this.getField(_2);
                                                 if(_2==null&&this.dataSource!=null) {
                                                                _2=this.getDataSource().getField(_1.displayField)
                                                 }
                                  }
                   }
                   return _2
    }
     
     
    isc_Canvas_getDataSource(){
                   if(isc.isA.String(this.dataSource)){
                                  if(this.serviceNamespace||this.serviceName){
                                                 this.dataSource=this.lookupSchema()
                                  } else{
                                                 var _1=isc.DS.get(this.dataSource);
                                                 if(_1!=null)
                                                                return _1;
                                                 _1=this.getWindow()[this.dataSource];
                                                 if(_1&&isc.isA.DataSource(_1))
                                                                return(this.dataSource=_1)
                                  }
                   }
                   return this.dataSource
    }

    #2
    We're not sure what you mean by "in view" but components which are hidden will still update their HTML if they are resized, which appears to be what's happening here.

    So that aspect is normal, although from a performance perspective, you might want to figure out how you end up resizing hidden components.

    As far as getDataSource() returning a String, that suggests that this grid was either given a bad value for listGrid.dataSource in the first place (didn't actually exist) or you've inadvertently destroyed the DataSource.

    Comment


      #3
      When we first login to this specific application, a listgrid is shown with some data. We double click on a row or single click then click on a menu that will take us to a screen with the details of that row. The screen with the details no longer has the listgrid on the page and we have called markedForDestroy on it when we changed the page. We no longer do anything with this listgrid once it is no longer on the screen so as you can see on the stacktrace, these calls are not from us. Do you know how we can find out what these Anonymous functions are? We do not have anything in our code that can be deemed anonymous.

      Comment


        #4
        What about the DataSource - are you destroy()ing that as well?

        Comment


          #5
          Actually, yes - we do listgrid.markForDestroy but for the data source, we call destroy()

          Comment


            #6
            OK, that's technically invalid since you're synchronously destroying something the grid depends on while the grid is still around, but we can certainly see that the framework encourages you to do this by not providing a markForDestroy() for DataSource.

            A quick workaround is to call setDataSource() on the ListGrid with some placeholder DataSource at the same time that you call markForDestroy() on it. Any DataSource that will stay around will do, but the simplest thing might be to create a stub DataSource with one field only, marked as the primaryKey.

            In the meantime we'll look at adding a markForDestroy() for DataSource or avoiding the issue in some other way.

            Comment


              #7
              Ok. What about just calling destroy() on the listgrid? Will this make a huge impact?

              Comment


                #8
                It's going to take a small amount of time, and can easily be an invalid call if you do it as a consequence of an event that's executing on the ListGrid.

                If you prefer not to use the setDataSource() approach, another approach would be to use Timer.setTimeout() to synchronously destroy() both the ListGrid and it's DataSource after a small delay.

                Comment


                  #9
                  The dummy datasource solves the problem. Thanks

                  Comment

                  Working...
                  X