Announcement

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

    JavaScriptException when setting Hilites on a grid

    I'm getting the following exception when displaying a grid if I add hilites to it. If I comment out the call to setHilites all is well.

    SmartClient Version: v8.2p_2012-05-09/PowerEdition Deployment (built 2012-05-09)

    Code:
    Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError): _4 is undefined
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:248)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
        at com.smartgwt.client.widgets.grid.ListGrid.create(ListGrid.java)
        at com.smartgwt.client.widgets.BaseWidget.getOrCreateJsObj(BaseWidget.java:361)
        at com.smartgwt.client.util.JSOHelper.convertToJavaScriptArray(JSOHelper.java:656)
        at com.smartgwt.client.widgets.BaseWidget.setAttribute(BaseWidget.java:708)
        at com.smartgwt.client.widgets.layout.Layout.setMembers(Layout.java:1121)
        at com.islandpacific.gui.client.purchasing.productionorder.DeliveryTab.getDeliveriesLayout(DeliveryTab.java:110)
        at com.islandpacific.gui.client.purchasing.productionorder.DeliveryTab.<init>(DeliveryTab.java:102)
        at com.islandpacific.gui.client.purchasing.productionorder.ProductionOrderEditor.<init>(ProductionOrderEditor.java:103)
        at com.islandpacific.gui.client.purchasing.productionorder.ProductionOrderNavigator.getEditor(ProductionOrderNavigator.java:630)
        at com.islandpacific.gui.client.purchasing.productionorder.ProductionOrderNavigator.access$1(ProductionOrderNavigator.java:628)
        at com.islandpacific.gui.client.purchasing.productionorder.ProductionOrderNavigator$11.onClick(ProductionOrderNavigator.java:425)
        at com.smartgwt.client.widgets.menu.events.MenuItemClickEvent.dispatch(MenuItemClickEvent.java:96)
        at com.smartgwt.client.widgets.menu.events.MenuItemClickEvent.dispatch(MenuItemClickEvent.java:1)
        at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
        at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
        at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
        at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
        at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
        at com.smartgwt.client.core.DataClass.fireEvent(DataClass.java:248)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
        at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
        at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
        at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
        at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
        at sun.reflect.GeneratedMethodAccessor96.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
        at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
        at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
        at java.lang.Thread.run(Thread.java:680)
    Here is the code that creates the Hilites array. I'm call listGrid.setHilites(getDeliveryHilites())
    Code:
    private Hilite[] getDeliveryHilites() {
    	Hilite unitsHilite = new Hilite();
    	AdvancedCriteria unitsHiliteCriteria = new AdvancedCriteria(ProductionDelivery.TOTAL_UNITS,
    			OperatorId.NOT_EQUAL_FIELD, ProductionDelivery.UNITS_SCHEDULED);
    	unitsHilite.setCriteria(unitsHiliteCriteria);
    	unitsHilite.setFieldName(ProductionDelivery.TOTAL_UNITS);
    	unitsHilite.setCssText("background-color:#FFFF99;");
    	Hilite packHilite = new Hilite();
    	AdvancedCriteria packHiliteCriteria = new AdvancedCriteria(OperatorId.OR, new Criterion[]{
    			new Criterion(ProductionDelivery.PACK_DETAILS, OperatorId.ICONTAINS, tbcColor),
    			new Criterion(ProductionDelivery.PACK_DETAILS, OperatorId.ICONTAINS, tbcSize)
    	});
    	packHilite.setCriteria(packHiliteCriteria);
    	packHilite.setFieldName(ProductionDelivery.PACK_COLORS);
    	packHilite.setCssText("background-color:#FFFF99;");	
    	return new Hilite[]{unitsHilite, packHilite};
    }

    #2
    I found that if I call setHilites() in a dataArrivedHandler on the grid it works fine.

    Comment


      #3
      Good to know. We are looking into this and don't yet have a solution.

      Sounds like this will give you a workaround, and meanwhile we'll try to get this resolved and update when we have got to the bottom of it.

      Regards
      Isomorphic Software

      Comment


        #4
        I'm still getting the error the first time the dataArrivedHandler is called. Refreshing the grid via invalidate cache causes the dataArrivedHandler to be triggered again and this second time no error. But it's the same data both times. ?

        Comment


          #5
          Thanks for the report - this was already addressed in 8.3 and we've now fixed it in 8.2p also - please retry with a nightly after 07/06

          Comment

          Working...
          X