Announcement

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

    SmartGWT - ISC_Core.JS : IE Error, Object Required

    Hello Guys,
    We are using, SmartGWT-2.2, GWT-2.0.3, JDK 1.6u19.

    On IE the following error happens:
    Code:
    Webpage error details
    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
    Timestamp: Wed, 18 Aug 2010 22:16:34 UTC
    
    Message: Object required
    Line: 1730
    Char: 85
    Code: 0
    URI: http://192.168.180.220:8080/PRJ/res/gwt/coastal/sc/modules/ISC_Core.js
    From the SmartGWT developer console we got the following:
    Code:
    10:12:33.250:MUP6:WARN:Log:Error:
     'Object required'
     in http://192.168.180.220:8080/PRJ/res/gwt/coastal/sc/modules/ISC_Core.js
     at line 1730
        [c]Element.getOffsetLeft(_1=>[DIVElement]{ID:isc_2D})
        [c]Element.$yw(_1=>"left", _2=>[DIVElement]{ID:isc_2D}, _3=>[BODYElement]{nodeName:BODY}, _4=>false)
        [c]Element.$s4(_1=>[DIVElement]{ID:isc_2D}, _2=>[BODYElement]{nodeName:BODY}, _3=>false)
        Canvas.$s4(_1=>undef)
        Canvas.getPageLeft()
        Canvas.containsPoint(_1=>777, _2=>527, _3=>false)
        Canvas.visibleAtPoint(_1=>777, _2=>527, _3=>undef, _4=>undef)
        [c]EventHandler.$k5(_1=>Obj{type:error}, _2=>undef)
        [c]EventHandler.handleMouseUp(_1=>Obj{type:error}, _2=>undef)
        [c]EventHandler.dispatch(_1=>[c]EventHandler.handleMouseUp(), _2=>Obj{type:error})
        anonymous(event=>undef)
            "var returnVal=arguments.callee.$ch.isc.EH.dispatch(arguments.callee.$j2,event);return returnVal;"
    Being a little bit more specific.
    The component from SmartGWT that we're using is "Calendar".
    The IE version that is presenting the error is 8.
    The error above doesn't occur on FF/GC/SF/Opera.

    Could you guys please give us some direction?
    Please let us know if you guys need more information.

    Thanks!
    Last edited by doomed; 18 Aug 2010, 18:49.

    #2
    This almost always results from mixing GWT and Smart GWT widgets inappropriately, see the FAQ.

    If you think your usage is consistent with the recommendations in the FAQ, try putting together a standalone test case.

    Comment


      #3
      Originally posted by Isomorphic
      This almost always results from mixing GWT and Smart GWT widgets inappropriately, see the FAQ.
      Hello Isomorphic,
      Yes, we are mixing GWT and SmartGWT.

      So far the components that we're using from SmartGWT are: Menu and Calendar.
      Being the Calendar the one that is giving us a little bit of hassle.
      Otherwise, we're using our GWT-InHouse components.

      We read the FAQ ( http://forums.smartclient.com/showth...hp?t=8159#aMix ) and we think that our usage is consistent with the recommendations.
      At the moment we would be looking at - "incremental migration" - where we need advanced components that GWT does not provide. (Calendar)

      We'll try to reproduce the presented issue/problem/bug in a standalone case shortly.
      In the meantime could you provide some directions on how we could solve the problem?

      Very appreciated your quick response.
      Please let us know if you need any further information.

      Thanks!
      Last edited by doomed; 18 Aug 2010, 14:57.

      Comment


        #4
        Oopz, should hit edit, not reply.
        Sorry about that. :)

        Comment


          #5
          Hi guys,
          just to let you know that we fixed the problem, here is our 2cents.

          1) Enable the SmartGWT Developer Console.
          Edit Your.gwt.xml to have the SmartGwtTools:
          Code:
          <inherits name="com.smartgwt.tools.SmartGwtTools" />
          To show the Developer console:
          Code:
          SC.showConsole();
          Tweak the SmartGWT setup:
          Code:
          <script>
          	/* Required by SmartGWT */
          	var isomorphicDir = "/PRJ/res/gwt/MODULE/sc/";
          	window.isc_useSimpleNames = false;
          </script>
          Get IE8 to emulate IE7 might also be a good idea:
          Code:
          <head>
          	<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
          <head>

          2) Do not attempt to destroy/create/attach SmartGWT objects.
          Hard to explain this but, what it happened in our case is that every time an event was removed from the Calendar we would create a new instance of the Calendar replacing the old one.
          On FF/SF/GC it works fine. However, when it comes to IE things change and a JS error would raise.

          In other words, defining the SmartGWT component as an instance object and initializing it there fixed the problem here. (Shared instance of SmartGWT component?)


          3) Be patient, as SmartGWT is a Java wrapper of a bunch of JavaScript files.
          It means that its not easy to debug it and some times will take time to get down the line.


          4) Read 1/2/3 again. ;)

          Happy coding!
          Last edited by doomed; 18 Aug 2010, 21:11.

          Comment


            #6
            doomed: Thanks A LOT for the advice - this was exactly what I needed. Plus, your post was extremely timely - I was dealing with the same issue yesterday and I'm glad someone found a solution just in time!

            Comment


              #7
              Originally posted by gtitievsky
              doomed: Thanks A LOT for the advice - this was exactly what I needed. Plus, your post was extremely timely - I was dealing with the same issue yesterday and I'm glad someone found a solution just in time!
              I can imagine the hassle that you were going through!
              Very pleased to hear that it helped you!

              This thread might be a good source on how to debug SmartGWT.
              As its a compilation of our founds on how to do it.
              Anyway, thanks for letting me know!


              Adding more 2cents..

              Always use the "SmartGWTComponent.resizeTo(String w, String h)" before returning the component.
              Code:
              Calendar calendar = new Calendar();
              // Set events, width, heigh, show/hide, etc..
              calendar.resizeTo(calendarWidth+"px", calendarHeight+"px");
              return calendar;
              It is somewhere in the documentation that you have to do it.

              Cheers! ;)
              Last edited by doomed; 19 Aug 2010, 14:25.

              Comment


                #8
                Originally posted by doomed
                I can imagine the hassle that you were going through!
                Very pleased to hear that it helped you!

                This thread might be a good source on how to debug SmartGWT.
                As its a compilation of our founds on how to do it.
                Anyway, thanks for letting me know!


                Adding more 2cents..

                Always use the "SmartGWTComponent.resizeTo(String w, String h)" before returning the component.
                Code:
                Calendar calendar = new Calendar();
                // Set events, width, heigh, show/hide, etc..
                calendar.resizeTo(calendarWidth+"px", calendarHeight+"px");
                return calendar;
                It is somewhere in the documentation that you have to do it.

                Cheers! ;)
                Hi,

                I am using gwt 2.4 and Smart gwt 2.4 on I.E 7,8,9

                Here I am using few Smart gwt components like TreeGrid, Dynamic forms etc inside gwt Grid. I know this is not at all a good practice and i am getting following error whenever my page loads or whenever I navigate to another page:

                16:01:18.578 [ERROR] [detectfiles] 16:01:18.578:TMR2:WARN:Log:Error:
                'Object required'
                in http://127.0.0.1:8888/detectfiles/sc/modules/ISC_Core.js
                at line 1782
                [c]Element.getOffsetLeft(_1=&gt;[DIVElement]{nodeName:DIV})
                [c]Element.getOffset(_1=&gt;&quot;left&quot;, _2=&gt;[TreeGrid ID:isc_TreeGrid_0], _3=&gt;undef, _4=&gt;false, _5=&gt;true)
                Canvas.getLeftOffset(_1=&gt;undef)
                Canvas.getPageLeft()
                Canvas.$414(null, undef)
                [c]Page.handleEvent(_1=&gt;null, _2=&gt;&quot;resize&quot;, _3=&gt;undef)
                [c]EventHandler.$78p(_1=&gt;&quot;landscape&quot;)
                [c]EventHandler.$hr(_1=&gt;undef)
                callback(undefined=&gt;undef)
                &quot;isc.EH.$hr()&quot;
                [c]Class.fireCallback(_1=&gt;&quot;isc.EH.$hr()&quot; , _2=&gt;undef, _3=&gt;Array[0], _4=&gt;Obj{length:4}, _5=&gt;true) on [Class Timer]
                [c]Timer.$in(_1=&gt;&quot;$ir70&quot;)
                anonymous()
                &quot;isc.Timer.$in('$ir70')&quot;

                com.smartgwt.client.core.JsObject$SGWT_WARN: 16:01:18.578:TMR2:WARN:Log:Error:
                'Object required'
                in http://127.0.0.1:8888/detectfiles/sc/modules/ISC_Core.js
                at line 1782
                [c]Element.getOffsetLeft(_1=&gt;[DIVElement]{nodeName:DIV})
                [c]Element.getOffset(_1=&gt;&quot;left&quot;, _2=&gt;[TreeGrid ID:isc_TreeGrid_0], _3=&gt;undef, _4=&gt;false, _5=&gt;true)
                Canvas.getLeftOffset(_1=&gt;undef)
                Canvas.getPageLeft()
                Canvas.$414(null, undef)
                [c]Page.handleEvent(_1=&gt;null, _2=&gt;&quot;resize&quot;, _3=&gt;undef)
                [c]EventHandler.$78p(_1=&gt;&quot;landscape&quot;)
                [c]EventHandler.$hr(_1=&gt;undef)
                callback(undefined=&gt;undef)
                &quot;isc.EH.$hr()&quot;
                [c]Class.fireCallback(_1=&gt;&quot;isc.EH.$hr()&quot; , _2=&gt;undef, _3=&gt;Array[0], _4=&gt;Obj{length:4}, _5=&gt;true) on [Class Timer]
                [c]Timer.$in(_1=&gt;&quot;$ir70&quot;)
                anonymous()
                &quot;isc.Timer.$in('$ir70')&quot;
                at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
                at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
                at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
                at java.lang.reflect.Constructor.newInstance(Construc tor.java:513)
                at com.google.gwt.dev.shell.MethodAdaptor.invoke(Meth odAdaptor.java:105)
                at com.google.gwt.dev.shell.MethodDispatch.invoke(Met hodDispatch.java:71)
                at com.google.gwt.dev.shell.OophmSessionHandler.invok e(OophmSessionHandler.java:172)
                at com.google.gwt.dev.shell.BrowserChannelServer.reac tToMessages(BrowserChannelServer.java:292)
                at com.google.gwt.dev.shell.BrowserChannelServer.proc essConnection(BrowserChannelServer.java:546)
                at com.google.gwt.dev.shell.BrowserChannelServer.run( BrowserChannelServer.java:363)
                at java.lang.Thread.run(Thread.java:662)


                But at this point of time its not possible for me to use Smart-gwt Layouts like HLayout or VLayout etc.

                Is there any either workaround for the same? Because all I get is a javascript error and my functionality is not hampered. Please please help me out. Following is my code:-

                package com.renault.detectfiles.client;

                import com.google.gwt.core.client.GWT;
                import com.google.gwt.event.dom.client.ClickEvent;
                import com.google.gwt.event.dom.client.ClickHandler;
                import com.google.gwt.user.client.ui.Button;
                import com.google.gwt.user.client.ui.Composite;
                import com.google.gwt.user.client.ui.Grid;
                import com.google.gwt.user.client.ui.HasHorizontalAlignme nt;
                import com.google.gwt.user.client.ui.HasVerticalAlignment ;
                import com.google.gwt.user.client.ui.ScrollPanel;
                import com.smartgwt.client.types.SelectionAppearance;
                import com.smartgwt.client.types.TreeModelType;
                import com.smartgwt.client.widgets.events.DrawEvent;
                import com.smartgwt.client.widgets.events.DrawHandler;
                import com.smartgwt.client.widgets.tree.Tree;
                import com.smartgwt.client.widgets.tree.TreeGrid;
                import com.smartgwt.client.widgets.tree.TreeNode;

                public class CheckStationTree extends Composite{
                private TreeNode[] lineTreeNode;
                private TreeGrid checkStationTree;
                private DFConstantsForLocale constants = GWT.create(DFConstantsForLocale.class);


                /**
                * @param lineTreeNode
                * @param checkStationTree
                */
                public CheckStationTree(TreeNode[] lineTreeNode, TreeGrid checkStationTree) {
                super();
                this.lineTreeNode = lineTreeNode;
                this.checkStationTree = checkStationTree;
                Grid grid = chckStatRestrictPanel();
                initWidget(grid);
                }

                /**
                * This function creates checkStation Restriction Panel(tree) along with
                * Select/Unselect All button
                *
                * @return
                */
                private Grid chckStatRestrictPanel() {
                ScrollPanel scrollChckStnResTree = new ScrollPanel();
                scrollChckStnResTree.add(createTreeGrid());
                scrollChckStnResTree.setWidth("250px");
                final Button selectAll = new Button(constants.selectAll());
                selectAll.setWidth("100px");
                selectAll.setStyleName("RnoBtn");
                final Button unselectAll = new Button(constants.unselectAll());
                unselectAll.setWidth("100px");
                unselectAll.setStyleName("RnoBtn");
                final Grid gridTable = new Grid(2, 1);
                selectAll(selectAll, unselectAll, gridTable);
                deselectAll(selectAll, unselectAll, gridTable);
                gridTable.setWidget(0, 0, scrollChckStnResTree);
                gridTable.setWidget(1, 0, selectAll);
                gridTable.setStyleName("alignLeft");
                gridTable.getCellFormatter().setHorizontalAlignmen t(1, 0, HasHorizontalAlignment.ALIGN_CENTER);
                gridTable.setHeight("297px");
                gridTable.getCellFormatter().setVerticalAlignment( 1, 0, HasVerticalAlignment.ALIGN_BOTTOM);
                gridTable.getCellFormatter().setVerticalAlignment( 0, 0, HasVerticalAlignment.ALIGN_TOP);
                return gridTable;
                }

                /**
                * @param selectAll
                * @param unselectAll
                * @param gridTable
                */
                private void deselectAll(final Button selectAll, final Button unselectAll, final Grid gridTable) {
                unselectAll.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                ImageLoader.openLoaderPanel();
                checkStationTree.deselectAllRecords();
                gridTable.setWidget(1, 0, selectAll);
                ImageLoader.closeLoader(false);
                }
                });
                }

                /**
                * @param selectAll
                * @param unselectAll
                * @param gridTable
                */
                private void selectAll(final Button selectAll, final Button unselectAll, final Grid gridTable) {
                selectAll.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                ImageLoader.openLoaderPanel();
                checkStationTree.selectAllRecords();
                gridTable.setWidget(1, 0, unselectAll);
                ImageLoader.closeLoader(false);
                }
                });
                }

                /**
                * This function creates CheckStation Restriction Tree
                *
                * @return {@link TreeGrid}
                */
                private TreeGrid createTreeGrid() {
                final TreeGrid chckTreeGrid = new TreeGrid();
                chckTreeGrid.setHeight("266px");
                chckTreeGrid.setWidth("250px");
                chckTreeGrid.setData(createChkStationTree());
                chckTreeGrid.setSelectionAppearance(SelectionAppea rance.CHECKBOX);
                chckTreeGrid.setShowPartialSelection(false);
                chckTreeGrid.setCascadeSelection(true);
                chckTreeGrid.setFolderIcon(null);
                chckTreeGrid.setNodeIcon(null);
                chckTreeGrid.setShowConnectors(true);
                chckTreeGrid.setShowHeader(false);
                chckTreeGrid.addDrawHandler(new DrawHandler() {
                public void onDraw(DrawEvent event) {
                chckTreeGrid.getTree().openAll();
                }
                });
                checkStationTree = chckTreeGrid;
                return chckTreeGrid;
                }

                /**
                * This function creates a basic tree
                */
                private Tree createChkStationTree() {
                Tree chckStationTree = new Tree();
                chckStationTree.setModelType(TreeModelType.PARENT) ;
                chckStationTree.setRootValue(1);
                chckStationTree.setIdField("id");
                chckStationTree.setNameProperty("name");
                chckStationTree.setOpenProperty("isOpen");
                chckStationTree.setData(lineTreeNode);
                chckStationTree.setParentIdField("parent");
                return chckStationTree;

                }


                /**
                * @return the checkStationTree
                */
                public final TreeGrid getCheckStationTree() {
                return checkStationTree;
                }

                /**
                * @param checkStationTree the checkStationTree to set
                */
                public final void setCheckStationTree(TreeGrid checkStationTree) {
                this.checkStationTree = checkStationTree;
                }

                /**
                * @return the lineTreeNode
                */
                public final TreeNode[] getLineTreeNode() {
                return lineTreeNode;
                }

                /**
                * @param lineTreeNode the lineTreeNode to set
                */
                public final void setLineTreeNode(TreeNode[] lineTreeNode) {
                this.lineTreeNode = lineTreeNode;
                }


                }

                Comment


                  #9
                  Hey doomed ,

                  Can you help me plzzzzzzzzzzzzzzzzz.........
                  Last edited by madhurar; 14 Jun 2012, 23:56.

                  Comment

                  Working...
                  X