Announcement

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

    nullpointer in placeEmbeddedComponent

    Hi,

    SNAPSHOT_v8.3d_2012-08-07/Pro Deployment (built 2012-08-07)
    FireFox 4


    I've got an Uncaught JavaScript exception [_19 is null] in http://127.0.0.1:8888/app/sc/modules/ISC_Grids.js, line 653

    which is a var in this JS code
    Code:
    function isc_GridRenderer_placeEmbeddedComponent 
    ...
    for (var i = 0; i < _17.length; i++) {
    	var _19 = _17[i];
    	var _20 = (_19.embeddedPosition == this.$57l);
    	if (_20)
    		continue;
    	var _21 = _19.getVisibleHeight();
    	if (_21 > _16) {
    		_16 = _21
    	}
    }
    which maps to this source code
    Code:
    var expandedComponentDelta = 0,
    	components = this.grid._getEmbeddedComponents(record);
    for (var i = 0; i< components.length; i++) {
    	var expComponent = components[i];
    	var isWithin = (expComponent.embeddedPosition == this._$within);
    	if (isWithin) continue;
    	var componentHeight = expComponent.getVisibleHeight();
    	if (componentHeight > expandedComponentDelta) {
    		expandedComponentDelta = componentHeight;
    	}
    }

    The previous build I used was from 17/07 and I see a fix for a similar problem was added afterwards:

    Code:
    function _getExtraEmbeddedComponentHeight
    ...
    var components = this.grid._getEmbeddedComponents(record)
    ...
        for (var i = 0; i < components.length; i++) {
            var component = components[i];
            
            if (!component) continue;
    maybe the same check is the solution in placeEmbeddedComponent?


    thanks,

    #2
    We can easily add the null check (and will do so)
    However it would be good to see a test case that reproduces this issue if possible so we can determine whether there's any additional work to do here (IE whether the fact that you were able to get into this state indicates a deeper framework bug or anything)

    Regardless - the null check will be present in the next nightly build.

    Comment


      #3
      I tried creating a standalone case, but it's not reproducing the error.

      What happens is the following:
      a grid having an innergrid as expansion canvas. Every record can have such an expansion innergrid (using the getExpansionComponent API). There is also a RecordComponent and a RollOverCanvas on that row. So multiple rows can be expanded together.

      There is a button which loads data in the grid (using a valuesmanager on the grid).
      A new fetch can contain a record from the previous fetch.
      Now it seems that if such a record (one which was already present in the grid) was expanded, then doing a fetch, I get that nullpointer exception on that record.
      So somehow, the code must think a record after the fetch is the same one as on the first fetch.
      That's a hunch at least, as I don't see the error on records which were not part of the 1st fetch. Does that make sense to you?

      I think as a workaround solution here, I will call the grid to collapse all expanded records before calling the fetch, as a collapse seems to destroy that innergrid. That might be a prettier UX flow anyway, and this exception might be fixed.

      Comment


        #4
        Thanks for the follow up. We will do some poking around in this area and see if we turn anything up.
        If you do continue to have trouble with it after our null check and your workaround doesn't prevent the issue from rearing it's head, let us know (that way we will know this is still a priority for you).

        Comment


          #5
          The workaround seems OK and fixes some more trouble as well (weird behaviour on row height not being reset after another fetch) - even without the null check.

          Since I've got some more expansion grids, it would be a good idea to have this auto-collapse code (loop all records, and collapse ifExpanded) somewhere in a generic place in my app. This calls for the question if we can have something like a DataArrivedEvent fired when the valuesManager sets data in a grid to trigger this code for my canExpandRecords-grids.

          Comment


            #6
            We have (yesterday) made some changes to the 3.1d branch which resolve some issues in this area.
            This may actually resolve the underlying issue for you so we'd recommend you retest with the latest nightly build (Aug 9 or higher).

            Comment


              #7
              getExpansionCompnent

              how to change background color for canvas

              Comment

              Working...
              X