Announcement

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

    SmartClient error

    Keep getting a browser error when displaying new element.

    One of the two types of errors occur.
    I wasn't able to figure out what actions determine what error occurs. Seems to be random.


    1. ERROR: "_13 is null", ISC_Core: ln 1948*

    STACK TRACE:

    14:59:58.403:RDQ6[E]:WARN:Log:TypeError: _13 is null
    [c]Element.getOffset(_1=>"left", _2=>[object HTMLSpanElement], _3=>[object HTMLDivElement], _4=>false, _5=>undef)
    [c]Element.getLeftOffset(_1=>[object HTMLSpanElement], _2=>[object HTMLDivElement])
    CanvasItem.placeCanvas()
    DynamicForm._notifyCanvasItems("placeCanvas")
    DynamicForm._placeCanvasItems()
    DynamicForm.modifyContent()
    Canvas._completeHTMLInit()
    Canvas.draw(undef, undef, undef, undef, undef, undef, undef, undef)
    Class.invokeSuper(_1=>{Obj}, _2=>"draw", _3=>undef, _4=>undef, _5=>undef, _6=>undef)
    DynamicForm.draw()
    Layout.layoutChildren("initial draw")
    Layout.drawChildren()
    Canvas.draw()
    Layout.layoutChildren("member changed visibility: [VStack ID:p..."[ 154])
    Layout.reflowNow("member changed visibility: [VStack ID:p..."[ 154], 11)
    unnamed()
    [c]EventHandler.runTeas()
    EventHandler._clearThread()
    [c]Canvas.clearRedrawQueue()
    [c]Class.fireCallback(_1=>{Obj}, _2=>undef, _3=>[object Array], _4=>{Obj}, _5=>true)
    Timer._fireTimeout("$ir430")
    unnamed()
    unnamed() @

    2. ERROR: "_13.scrollLeft is null", ISC_Core: ln 1948*

    STACK TRACE:

    14:44:51.762:WARN:Log:TypeError: _13.scrollLeft is null
    [c]Element.getOffset(_1=>"left", _2=>[object HTMLSpanElement], _3=>[object HTMLDivElement], _4=>false, _5=>undef)
    [c]Element.getLeftOffset(_1=>[object HTMLSpanElement], _2=>[object HTMLDivElement])
    CanvasItem.placeCanvas()
    DynamicForm._notifyCanvasItems("placeCanvas")
    DynamicForm._placeCanvasItems()
    DynamicForm.modifyContent()
    Canvas._completeHTMLInit()
    Canvas.draw(undef, undef, undef, undef, undef, undef, undef, undef)
    Class.invokeSuper(_1=>{Obj}, _2=>"draw", _3=>undef, _4=>undef, _5=>undef, _6=>undef)
    DynamicForm.draw()
    Layout.layoutChildren("initial draw")
    Layout.drawChildren()
    Canvas.draw()
    Layout.layoutChildren("member changed visibility: [VStack ID:p..."[ 154])
    Layout.reflowNow("member changed visibility: [VStack ID:p..."[ 154], 33)
    unnamed()
    [c]EventHandler.runTeas()
    EventHandler._clearThread()
    [c]Canvas.clearRedrawQueue()
    [c]Class.fireCallback(_1=>{Obj}, _2=>undef, _3=>[object Array], _4=>{Obj}, _5=>true)
    Timer._fireTimeout("$ir1564")
    unnamed()
    unnamed() @


    Please suggest a fix or what can we do to debug and understand what's happening.



    * Isc_Core: ln 1948
    1948var _13=_11.offsetParent;if(isc.Browser.isMoz&&_13==null)return 0;var _14=_12.offsetParent,_15=_11,_16=0,_17=(_1==isc.Canvas.LEFT),_18=(_17?this.$w2:this.$w3),_19=(_17?this.$oi:this.$ok);if(!_17)_4=false;else if(_4==null)_4=(isc.Page.getTextDirection()==isc.Canvas.RTL);var _20=0;while(_13!=_12&&_13!=_14){var _21=(_17?this.ns.Element.getOffsetLeft(_15):this.ns.Element.getOffsetTop(_15));_16+=_21;if(!_4){_16-=((_17?_13.scrollLeft:_13.scrollTop)||0)}else{if(isc.isA.Number(_13.scrollLeft)){var _22=(_13.scrollWidth-_13.clientWidth);_16+=(_22-_13.scrollLeft)}}




    SmartClient Version: SC_SNAPSHOT-2011-11-10/PowerEdition Development Only (built 2011-11-10)

    #2
    You've wiped out SmartClient's rendered DOM via direct DOM manipulation. We know your team is using GWT with SmartClient without SmartGWT, but we see people reporting this error with SmartGWT every so often, and it's in the SmartGWT FAQ. A typical cause is doing something like (GWT)Panel.clear() where there are SmartClient components inside the Panel.

    Comment


      #3
      We only use GWT for client/server communication - We don't actually use GWT for UI stuff.

      Comment


        #4
        It's either your GWT usage clearing out the DOM, or some other direct-to-DOM coding you (or a third-party library) is doing. We'd look very hard at GWT first. Using GWT just for client-server comm does not imply that it leaves the DOM entirely alone (history management, script tag insertion, etc).
        Last edited by Isomorphic; 17 Nov 2011, 12:26.

        Comment


          #5
          Was able to reproduce as a standalone - also, I've pinpointed it to markForDestroy() - I've tested with destroy() and it works fine. The problem lies in the group3 section. We have two dynamic forms both having a section item called group3.

          Reproduceable in IE and FF. It first fails at "_5=_11.currentStyle"

          "Object required ISC_Core.js, line 1930 character 105"

          Code:
          
          
          <HTML><HEAD><TITLE>Mark For Destroy Error</TITLE>
              <SCRIPT>var isomorphicDir = "isomorphic/"</SCRIPT>
              <SCRIPT SRC=isomorphic/system/modules/ISC_Core.js></SCRIPT>
              <SCRIPT SRC=isomorphic/system/modules/ISC_Foundation.js></SCRIPT>
              <SCRIPT SRC=isomorphic/system/modules/ISC_Containers.js></SCRIPT>
              <SCRIPT SRC=isomorphic/system/modules/ISC_Grids.js></SCRIPT>
              <SCRIPT SRC=isomorphic/system/modules/ISC_Forms.js></SCRIPT>
              <SCRIPT SRC=isomorphic/system/modules/ISC_DataBinding.js></SCRIPT>
          	<SCRIPT SRC=isomorphic/skins/Enterprise/load_skin.js></SCRIPT>
          </HEAD><BODY CLASS="pageBackground">
          
          
          <SCRIPT>
          
          isc.setAutoDraw(false);
          
          isc.VLayout.create({ID:"testVLayout", width: 300});
          isc.TreeGrid.create({
              ID: "employeeTree",
              
              data: isc.Tree.create({
                  modelType: "children",
                  nameProperty: "Name",
                  childrenProperty: "directReports",
                  root: {EmployeeId: "1", directReports: [
                      {EmployeeId:"4", Name:"Charles Madigen", directReports: [
                          {EmployeeId:"188", Name:"Rogine Leger"},
                          {EmployeeId:"189", Name:"Gene Porter", directReports: [
                              {EmployeeId:"265", Name:"Olivier Doucet"},
                              {EmployeeId:"264", Name:"Cheryl Pearson"}
                          ]}
                      ]}
                  ]}
              }),
          
              // customize appearance
              width: 500,
              height: 400,
              nodeIcon:"icons/16/person.png",
              folderIcon:"icons/16/person.png",
              showOpenIcons:false,
              showDropIcons:false,
              closedIconSuffix:"",
          
          recordClick: function(viewer, record, recordNum, field, fieldNum, value, rawValue){
          	
          	if(this.cwTestGrid!=null)
          		this.cwTestGrid.markForDestroy();
          		
          		if(recordNum == 1){
          			this.cwTestGrid = isc.VStack.create({
          							ID:"orderHeaderGrid_vCentering",
          							name:"orderHeaderGrid_vCentering",
          							vPolicy:"fill",hPolicy:"fill",
          							height:"100%",width:"100%",members:
          							[isc.DynamicForm.create({
          							width:960,
          							ID:"orderHeaderGrid",
          							name:"orderHeaderGrid",
          							numCols:4,
          							colWidths:["240","240","240","240"],
          							titleOrientation:"top",
          							fields:
          							[{_constructor:"SectionItem",
          							isFirstFocusable:false,
          							ID:"group3",
          							title:"External Interface &nbsp;",
          							canCollapse:false,
          							defaultValue:"External Interface",
          							sectionExpanded:true,
          							endRow:true,itemIds:[]}]})]});
          
          		}
          		if(recordNum == 2){
          			   this.cwTestGrid = isc.VStack.create({
          							ID:"siteAddressGrid_vCentering",
          							name:"siteAddressGrid_vCentering",
          							vPolicy:"fill",hPolicy:"fill",
          							height:"100%",width:"100%",members:
          							[isc.DynamicForm.create({
          							width:960,
          							ID:"siteAddressGrid",
          							name:"siteAddressGrid",
          							numCols:4,
          							colWidths:["240","240","240","240"],
          							titleOrientation:"top",
          							fields:
          							[{_constructor:"SectionItem",
          							isFirstFocusable:false,
          							ID:"group3",
          							title:"GAV Location&nbsp;",
          							canCollapse:false,
          							defaultValue:"GAV Location",
          							sectionExpanded:true,
          							endRow:true,itemIds:[]}]})]});
          		}
          		
          		if(recordNum == 3){
          			this.cwTestGrid = isc.VStack.create({
          							ID:"accessGrid_vCentering",
          							name:"accessGrid_vCentering",
          							vPolicy:"fill",hPolicy:"fill",
          							height:"100%",width:"100%",members:
          							[isc.DynamicForm.create({
          							width:960,
          							ID:"accessGrid",
          							name:"accessGrid",
          							numCols:4,
          							colWidths:["240","240","240","240"],
          							titleOrientation:"top",
          							fields:
          							[{_constructor:"HeaderItem",
          							isFirstFocusable:false,
          							defaultValue:"access"}]})]});
          		
          		}
          		
          		
          		
          	testVLayout.addMember(this.cwTestGrid);
          	}
          });
          
          
          
          isc.HLayout.create({ID:"testHLayout", autoDraw:true,members:[employeeTree, testVLayout]});
          
          </script>
          </body></html>
          Last edited by acarur01; 8 Dec 2011, 07:57.

          Comment


            #6
            This error is preceded in the logs by a warning about colliding IDs, because what's happening is, the new form is destroying parts of the old form as it's being created, including the generated Section header which is part of a CanvasItem.

            You can prevent this, as you've noted, via destroy() instead of markForDestroy(). Generally, use markForDestroy() if you are in the middle of an event handler in the widget you want to destroy, because it's invalid to destroy a widget *during* event handling. If you're done with a widget and you're creating a new set of components that will possibly collide on global IDs, destroy() the old widgets first before creating the new ones.

            Comment


              #7
              But how to do I even detect that they could possibly collide? In our system, this would mean calling destroy() on all the layouts - how do I pinpoint when to call it and when to call markForDestroy?

              Comment


                #8
                Remember, we don't have your code in front of us :)

                As a general approach, if you've called markForDestroy() on something then presumably your code is assuming that any IDs you used in that widget hierarchy are now free to re-use. So you could make sure anything you've marked for destroy is in fact synchronously destroyed before you show new widgets.

                Comment

                Working...
                X