Announcement

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

    CubeGrid doesn't show it

    Hi, after I resolved the problem with the right path of analytics .js file, now I have a new question for you.

    Even if I followed the showcase example, applying it on myProject case, CubeGrid doesn't show and the code returns me a large exception.

    This is my code
    Code:
    public Business(final TabSet mainTabSet, String panelID) {
    		super(mainTabSet);
    		this.setID(panelID);
    		this.onModuleLoad();
    	}
        
    	public void onModuleLoad() {  
    
                cubeGrid = new CubeGrid() {			
        			@Override  
        			protected Canvas getExpansionComponent(ListGridRecord record) {  
        				Canvas canvas = super.getExpansionComponent(record);  
        				canvas.setMargin(5);  
        				return canvas;  
        			}
        		};
    	    	//in order to enable charting, the Drawing module must be present  
    	        if(SC.hasDrawing()) {  
    	        	cubeGrid.setEnableCharting(true);  
    	        }  
    	        DataSource ds = DataSource.get("ds");
    	        cubeGrid.setDataSource(ds);
    	        cubeGrid.setFetchOperation("cubeGrid");
    	        
    	        cubeGrid.setWidth100();  
    	        cubeGrid.setHeight100();  
    	        cubeGrid.setHideEmptyFacetValues(true);  
    	        cubeGrid.setShowCellContextMenus(true);  
    	  
    	        final NumberFormat numberFormat = NumberFormat.getFormat("0,000");  
    	        
    	        cubeGrid.setCellFormatter(new CellFormatter() {  
    	        	public String format(Object value, ListGridRecord record, int rowNum, int colNum) {  
    	        		if (value == null) return null;  
    	        			try {  
    	                        return numberFormat.format(((Number) value).longValue());  
    	                    } catch (Exception e) {  
    	                        return value.toString();  
    	                    }  
    	                }  
    	            });  
            
            
            cubeGrid.setColumnFacets("COL1", "COL2", "COL3");  
            cubeGrid.setRowFacets("COL4", "COL5");  
                       
            this.vLayout.addMember(cubeGrid);
        }
    In Datasource ds I have correctly built the query to exctract data. The rest of the code is the same of the showcase, except for the starting constructor

    the following is the thrown exception
    Code:
    16:33:34.977 [ERROR] [myProject] Uncaught exception escaped
    com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, see full set in UmbrellaException#getCauses
        at com.google.gwt.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:214)
        at com.google.gwt.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:103)
        at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:101)
        at com.smartgwt.client.widgets.BaseWidget.fireEvent(BaseWidget.java:67)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:600)
        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:157)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126)
        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:214)
        at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:600)
        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:157)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
        at java.lang.Thread.run(Thread.java:736)
    Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError): _1 is undefined
     fileName: http://127.0.0.1:8888/myProject/sc/modules/ISC_Analytics.js
     lineNumber: 132
     stack: isc_CubeGrid_setFacets()@http://127.0.0.1:8888/myProject/sc/modules/ISC_Analytics.js:132
    isc_CubeGrid_initWidget([object Object],(void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0))@http://127.0.0.1:8888/myProject/sc/modules/ISC_Analytics.js:54
    isc_Canvas_init([object Object],(void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0))@http://127.0.0.1:8888/myProject/sc/modules/ISC_Core.js:2021
    isc_Class_completeCreation([object Object],(void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0),(void 0))@http://127.0.0.1:8888/myProject/sc/modules/ISC_Core.js:364
    isc_c_Class_create([object Object])@http://127.0.0.1:8888/myProject/sc/modules/ISC_Core.js:234
    ()@http://127.0.0.1:8888:465
    @:0
    ([object GWTJavaObject],1179847,[object GWTJavaObject])@http://127.0.0.1:8888/myProject/hosted.html?myProject:56
    ([object Object],[object Object],12)@http://127.0.0.1:8888:508
    ((function () {var param = {viewer: arguments[0], leaf: arguments[1], recordNum: arguments[2]};var event = __gwt_makeJavaInvoke(1)(null, 17825903, param);__gwt_makeJavaInvoke(1)(selfJ, 1179847, event);}),[object Object],[object Object])@http://127.0.0.1:8888:12
    @:0
    (null,65634,(function () {var param = {viewer: arguments[0], leaf: arguments[1], recordNum: arguments[2]};var event = __gwt_makeJavaInvoke(1)(null, 17825903, param);__gwt_makeJavaInvoke(1)(selfJ, 1179847, event);}),[object Object],[object Object])@http://127.0.0.1:8888/myProject/hosted.html?myProject:56
    ([object Object],[object Object],12)@http://127.0.0.1:8888:58
    isc_TreeGrid_rowClick([object Object],12,0)@http://127.0.0.1:8888/myProject/sc/modules/ISC_Grids.js:3016
    anonymous([object Object],12,0)@http://127.0.0.1:8888/myProject/sc/modules/ISC_Grids.js:993
    isc_GridRenderer__rowClick(12,0)@http://127.0.0.1:8888/myProject/sc/modules/ISC_Grids.js:795
    isc_GridRenderer_click([object Object],(void 0))@http://127.0.0.1:8888/myProject/sc/modules/ISC_Grids.js:792
    isc_c_Class_invokeSuper(null,"click")@http://127.0.0.1:8888/myProject/sc/modules/ISC_Core.js:305
    isc_c_Class_Super("click",[object Object])@http://127.0.0.1:8888/myProject/sc/modules/ISC_Core.js:297
    isc_TreeGridBody_click([object Object],(void 0))@http://127.0.0.1:8888/myProject/sc/modules/ISC_Grids.js:2957
    isc_Canvas_handleClick([object Object],(void 0))@http://127.0.0.1:8888/myProject/sc/modules/ISC_Core.js:3151
    isc_c_EventHandler_bubbleEvent([object Object],"click")@http://127.0.0.1:8888/myProject/sc/modules/ISC_Core.js:1610
    isc_c_EventHandler_handleClick([object Object])@http://127.0.0.1:8888/myProject/sc/modules/ISC_Core.js:1458
    isc_c_EventHandler__handleMouseUp([object MouseEvent],(void 0))@http://127.0.0.1:8888/myProject/sc/modules/ISC_Core.js:1445
    isc_c_EventHandler_handleMouseUp([object MouseEvent])@http://127.0.0.1:8888/myProject/sc/modules/ISC_Core.js:1436
    isc_c_EventHandler_dispatch(isc_c_EventHandler_handleMouseUp,[object MouseEvent])@http://127.0.0.1:8888/myProject/sc/modules/ISC_Core.js:1673
    anonymous([object MouseEvent])@http://127.0.0.1:8888/myProject/sc/modules/ISC_Core.js:61
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:237)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126)
        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.cube.CubeGrid.create(CubeGrid.java)
        at com.smartgwt.client.widgets.BaseWidget.getOrCreateJsObj(BaseWidget.java:361)
        at com.smartgwt.client.widgets.layout.Layout.addMember(Layout.java:1131)
        at it.ccg.myProject.client.nelli.Business.onModuleLoad(Business.java:102)
        at it.ccg.myProject.client.nelli.Business.<init>(Business.java:57)
        at it.ccg.myProject.client.nelli.Business$Factory.create(Business.java:135)
        at it.ccg.myProject.client.Main.showSample(Main.java:219)
        at it.ccg.myProject.client.Main.access$0(Main.java:203)
        at it.ccg.myProject.client.Main$2.onLeafClick(Main.java:83)
        at com.smartgwt.client.widgets.tree.events.LeafClickEvent.dispatch(LeafClickEvent.java:98)
        at com.smartgwt.client.widgets.tree.events.LeafClickEvent.dispatch(LeafClickEvent.java:1)
        at com.google.gwt.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:204)
        at com.google.gwt.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:103)
        at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:101)
        at com.smartgwt.client.widgets.BaseWidget.fireEvent(BaseWidget.java:67)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:600)
        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:157)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126)
        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:214)
        at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:600)
        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:157)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
        at java.lang.Thread.run(Thread.java:736)
    I supposed it could be the same case of this post

    http://forums.smartclient.com/showth...light=cubegrid

    so I have rebuilt the project and cleaned the cash of my browser, but the thrown exception is the same, and I'm sure that the version of analytics.jar and the smartgwt .jars too are the same (v. 2.4).

    Could you help me to fix also this problem?
    Last edited by GuiRider; 20 Jun 2011, 07:19.

    #2
    Try moving all other settings on the CubeGrid before setDataSource().

    Comment


      #3
      I tried with the classes of showcase and it works fine.

      Now I'm attempting to load data from data source by creating a ListGridRecord to use in method cubeGrid.setData() as following

      Code:
      DataSource ds = DataSource.get("table");
      
      cubeGrid.setDataSource(ds);
      cubeGrid.setFetchOperation("cubeGrid");
      	        
      ListGridField col1= new ListGridField("COL1");
      ListGridField col2= new ListGridField("COL2");
      ListGridField col3= new ListGridField("COL3");
      ListGridField col4= new ListGridField("COL4");
      ListGridField col5= new ListGridField("COL5");
      	        
      	        
      ListGridRecord record1= new ListGridRecord();
      ListGridRecord record2= new ListGridRecord();
      ListGridRecord record3= new ListGridRecord();
      ListGridRecord record4= new ListGridRecord();
      ListGridRecord record5= new ListGridRecord();
      	        
      	        
      record1.setAttribute("r1", col1);
      record2.setAttribute("r2", col2);
      record3.setAttribute("r3", col3);
      record4.setAttribute("r4", col4);
      record5.setAttribute("r5", col5);
      	        
      ListGridRecord[] listGridRecord = new ListGridRecord[]{record1,record2,record3,record4,record5};
      	        
      cubeGrid.setData(listGridRecord);
      	        
      cubeGrid.setWidth100();  
      cubeGrid.setHeight100();  
      cubeGrid.setHideEmptyFacetValues(true);  
      cubeGrid.setShowCellContextMenus(true);  
      	  
      final NumberFormat numberFormat = NumberFormat.getFormat("0,000");  
      	        
      cubeGrid.setCellFormatter(new CellFormatter() {  
          public String format(Object value, ListGridRecord record, int rowNum, int colNum) {  
              if (value == null) return null;  
      	    try {  
      	          return numberFormat.format(((Number) value).longValue());  
      	    } catch (Exception e) {  
      	        return value.toString();  
                  }  
      	}  
          });  
              
              
      cubeGrid.setColumnFacets("r1", "r2", "r3");  
      cubeGrid.setRowFacets("r4", "r5");
      I've chosen this way because the ProductRevenue class in showcase extends ListGridRecord so I thought it could be a similar solution, but when I execute my project I obtain this exception on server console

      Code:
      [ERROR] [myProject] - 16:54:44.181:MUP7:WARN:CubeGrid:isc_Business_1_0:No such facetValue undefined in facet r1
      16:54:44.181:MUP7:WARN:CubeGrid:isc_Business_1_0:No such facetValue undefined in facet r4
      At this point, I ask for you how I can load my data set without the use of external class?
      Last edited by GuiRider; 21 Jun 2011, 07:22.

      Comment


        #4
        Your dataset makes no sense with the facets (actually it is not even a cube dataset at all). See the overview class doc of the CubeGrid and especially the doc for facets and cellRecord.

        Comment


          #5
          Hi,

          I'm happy to communicate you that cube grid now works fine!

          I've chosen the way of directly fetching from data source and build a set of record to use in the method cubeGrid.setData

          Now I've a cube grid like the showcase, but a new issue blocks me when I attempt to view the chart. The right click on value area isn't enabled and the server console shows me this exception message:

          Code:
          12:00:07.087 [ERROR] [myProject] 12:00:07.069:CXT7:WARN:Log:TypeError: _3 is null
              CubeGrid.getCellChartMenu(_1=>34,  _2=>0) @ myProject/sc/modules/ISC_Analytics.js:656
              CubeGrid.makeCellContextItems(_1=>undef,  _2=>34,  _3=>0) @ myProject/sc/modules/ISC_Analytics.js:682
              ListGrid._cellContextClick(undef, 34, 0) @ myProject/sc/modules/ISC_Grids.js:1675
              GridBody.cellContextClick(record=>undef, rowNum=>34, colNum=>0) @ myProject/sc/modules/ISC_Grids.js:867
              GridRenderer.showContextMenu(event=>{Obj}) @ myProject/sc/modules/ISC_Grids.js:769
              Canvas.handleShowContextMenu(_1=>{Obj}, undefined=>undef) @ myProject/sc/modules/ISC_Core.js:3132
              [c]EventHandler.bubbleEvent(_1=>{Obj},  _2=>"showContextMenu") @ myProject/sc/modules/ISC_Core.js:1610
              EventHandler._handleContextMenu([object MouseEvent]) @ myProject/sc/modules/ISC_Core.js:1454
              [c]EventHandler.handleContextMenu(_1=>[object MouseEvent]) @ myProject/sc/modules/ISC_Core.js:1449
              [c]EventHandler.dispatch(_1=>isc_c_EventHandler_handleContextMenu,  _2=>[object MouseEvent]) @ myProject/sc/modules/ISC_Core.js:1673
              anonymous([object MouseEvent]) @ myProject/sc/modules/ISC_Core.js:61
              unnamed() @
          Is there the possibility that somethings in recordSet is still missing??

          Thank you for your help and patience!

          Comment


            #6
            It's not completely clear from the stack trace, but it seems like you might have setMetricFacetId to a facet that doesn't exist, or perhaps you clicked on a blank cell? Runnable code would make it easy to see the actual problem.

            Comment


              #7
              Hi Isomorphic,

              I cant make the cubegrid working. I think I have followed all the steps and I have build a simple test but it is not working at all.

              Here is my java code in onmoduleload method:



              DSRequest requestSeries = new DSRequest();

              requestSeries.setOperationId("serieIngresosFetch");

              DataSource.get("ingresos").fetchData(null, new DSCallback() {

              @Override

              public void execute(DSResponse response, Object rawData, DSRequest request) {

              // TODO Auto-generated method stub


              final RecordList seriesIngresos = response.getDataAsRecordList();

              final Facet serie = new Facet();
              serie.setId("serie");
              serie.setTitle("SERIE");

              FacetValue[] facetsSerie = new FacetValue[seriesIngresos.getLength()];

              for (int i=0;i< seriesIngresos.getLength();i++)
              {



              facetsSerie[i] = new FacetValue(seriesIngresos.get(i).getAttribute("nombreSerieIngreso"), seriesIngresos.get(i).getAttribute("nombreSerieIngreso"));

              }

              serie.setValues(facetsSerie);

              DSRequest requestOfertas = new DSRequest();

              requestOfertas.setOperationId("ofertaIngresosFetch");

              DataSource.get("ingresos").fetchData(null, new DSCallback() {

              @Override

              public void execute(DSResponse response, Object rawData, DSRequest request) {

              // TODO Auto-generated method stub


              final RecordList ofertasIngresos = response.getDataAsRecordList();

              final Facet oferta = new Facet();
              oferta.setId("oferta");
              oferta.setTitle("OFERTA");

              FacetValue[] facetsOferta = new FacetValue[ofertasIngresos.getLength()];

              for (int i=0;i< ofertasIngresos.getLength();i++)
              {



              facetsOferta[i] = new FacetValue(ofertasIngresos.get(i).getAttribute("tituloOferta"), ofertasIngresos.get(i).getAttribute("tituloOferta"));

              }

              oferta.setValues(facetsOferta);


              DSRequest requestMeses = new DSRequest();

              requestMeses.setOperationId("mesIngresosFetch");

              DataSource.get("ingresos").fetchData(null, new DSCallback() {

              @Override

              public void execute(DSResponse response, Object rawData, DSRequest request) {

              // TODO Auto-generated method stub


              final RecordList mesIngresos = response.getDataAsRecordList();

              final Facet mes = new Facet();
              mes.setId("mes");
              mes.setTitle("MES");

              FacetValue[] facetsMes = new FacetValue[mesIngresos.getLength()];

              for (int i=0;i< mesIngresos.getLength();i++)
              {



              facetsMes[i] = new FacetValue(mesIngresos.get(i).getAttribute("mes"), mesIngresos.get(i).getAttribute("mes"));

              }

              mes.setValues(facetsMes);

              if(SC.hasAnalytics())

              {



              final CubeGrid advancedCube = new CubeGrid();

              advancedCube.setFetchOperation("ingresosFetch");

              if(SC.hasDrawing()) {
              advancedCube.setEnableCharting(true);
              }

              advancedCube.setWidth100();

              advancedCube.setHeight100();

              advancedCube.setFacets(serie,oferta,mes);






              advancedCube.setHideEmptyFacetValues(true);

              advancedCube.setShowCellContextMenus(true);






              advancedCube.setRowFacets("serie","oferta");
              advancedCube.setColumnFacets("mes");
              advancedCube.setValueProperty("_value");

              advancedCube.setDataSource(DataSource.get("ingresos"));
              advancedCube.setAutoFetchData(true);

              VLOInformes.addMember(advancedCube);
              }



              }

              },requestMeses);

              }

              },requestOfertas);

              }

              },requestSeries);



              And here is my datasource definition ingresos.ds.xml:

              <DataSource
              ID="ingresos"
              serverType="sql"
              tableName="ingresos"
              >
              <fields>
              <field name="ingresoID" type="sequence" title="ingresoID" primaryKey="true" hidden="true"/>
              <field name="numeroFacturaIngreso" type="integer" title="NUMERO FACTURA"/>
              <field name="fechaFacturaIngreso" type="date" title="FECHA FACTURA"/>
              <field name="clienteID" type="integer" title="CLIENTE" foreignKey="clientes.clienteID" displayField="denominacionSocial" valueField="clienteID"/>
              <field name="ofertaID" type="integer" title="OFERTA" foreignKey="ofertas.ofertaID" displayField="tituloOferta" valueField="ofertaID"/>
              <field name="serieIngresosID" type="integer" title="SERIE INGRESOS" foreignKey="seriesIngresos.serieIngresosID" displayField="nombreSerieIngresos" valueField="serieIngresosID"/>
              <field name="fechaCobro" type="date" title="FECHA COBRO"/>
              <field name="iva" type="text" title="IVA" hint="%"/>
              <field name="baseImponible" type="float" title="BASE IMPONIBLE" canEdit="false" hint="€"/>
              <field name="importeIVA" type="float" title="IMPORTE IVA" canEdit="false" hint="€"/>
              <field name="importeTotal" type="float" title="IMPORTE TOTAL" canEdit="false" hint="€"/>
              <field name="prefacturaIngresos" type="boolean" title="ES PREFACTURA"/>

              </fields>

              <operationBindings>

              <operationBinding operationType="fetch" operationId="numFacturaMax">
              <customSQL>
              SELECT MAX(numeroFacturaIngreso) AS numFacturaIngreso FROM ingresos
              </customSQL>
              </operationBinding>

              <operationBinding operationType="fetch" operationId="ingresosFetch">

              <customSQL>

              SELECT SI.nombreSerieIngresos AS serie,O.tituloOferta AS oferta, MONTHNAME(fechaFacturaIngreso) as mes, SUM(`baseImponible`) AS _value FROM `ingresos` AS I INNER JOIN seriesIngresos AS SI ON I.serieIngresosID = SI.serieIngresosID INNER JOIN ofertas AS O ON I.ofertaID = O.ofertaID GROUP BY serie,oferta,mes
              </customSQL>

              </operationBinding>

              <operationBinding operationType="fetch" operationId="serieIngresosFetch">

              <customSQL>

              SELECT DISTINCT(I.serieIngresosID) AS serieIngreso,SI.nombreSerieIngresos AS nombreSerieIngreso FROM `ingresos` AS I INNER JOIN seriesIngresos AS SI ON I.serieIngresosID = SI.serieIngresosID INNER JOIN ofertas AS O ON I.ofertaID = O.ofertaID

              </customSQL>

              </operationBinding>

              <operationBinding operationType="fetch" operationId="ofertaIngresosFetch">

              <customSQL>

              SELECT DISTINCT(I.ofertaID) AS ofertaID,O.tituloOferta AS tituloOferta FROM `ingresos` AS I INNER JOIN seriesIngresos AS SI ON I.serieIngresosID = SI.serieIngresosID INNER JOIN ofertas AS O ON I.ofertaID = O.ofertaID

              </customSQL>

              </operationBinding>

              <operationBinding operationType="fetch" operationId="mesIngresosFetch">

              <customSQL>

              SELECT DISTINCT(MONTHNAME(fechaFacturaIngreso)) AS mes FROM `ingresos` AS I INNER JOIN seriesIngresos AS SI ON I.serieIngresosID = SI.serieIngresosID INNER JOIN ofertas AS O ON I.ofertaID = O.ofertaID

              </customSQL>

              </operationBinding>


              </operationBindings>





              </DataSource>

              I am using SmartGwt Power Edition Last Nigthly Build with Internet Explorer 8 and I cant put it working.

              Could you please tell me if I am doing something wrong?

              Thanks in advance and looking forward your answer.

              Pablo

              Comment


                #8
                In the message I post, it shows an empty space in the datasource definition of the cubegrid but its a typpo.

                In the code I have:

                advancedCube.setDataSource(DataSource.get("ingresos"));

                I hope you could help me.

                Thanks

                Comment


                  #9
                  Again, maybe that is the problem:

                  DataSource.get("ingresos"));

                  Comment


                    #10
                    It was not the problem. It doesnt work.

                    Looking forward your answer and thanks

                    Comment


                      #11
                      There is no way to troubleshoot this until we can see the data returned by your server - get it from the RPC tab in the Developer Console.

                      Also, for the JavaScript error, get a stack trace using the instructions in the FAQ.

                      Be sure to post code sample code with "code" tags so you don't lose formatting.

                      Comment


                        #12
                        Hi isomorphic,

                        Here is the javascript Exception:

                        <code>

                        19:50:50.429 [ERROR] [plantillaIdeiak] 19:50:50.413:XRP2[E]:WARN:Log:Error: ''this.rowFields[...].0.facet' es nulo o no es un objeto' in http://127.0.0.1:8888/plantillaIdeiak/sc/modules/ISC_Analytics.js at line 446
                        CubeGrid.createRowHeaderBars(_1=>undef) CubeGrid.createChildren() ListGrid.prepareForDraw() Class.invokeSuper(_1=>null, _2=>"prepareForDraw", _3=>undef, _4=>undef, _5=>undef, _6=>undef, _7=>undef, _8=>undef, _9=>undef, _10=>undef) Class.Super(_1=>"prepareForDraw", _2=>Obj{length:0}, _3=>undef) CubeGrid.prepareForDraw() ListGrid.draw(_1=>undef, _2=>undef, _3=>undef, _4=>undef) ** recursed on Class.invokeSuper
                        com.smartgwt.client.core.JsObject$SGWT_WARN: 19:50:50.413:XRP2[E]:WARN:Log:Error: ''this.rowFields[...].0.facet' es nulo o no es un objeto' in http://127.0.0.1:8888/plantillaIdeiak/sc/modules/ISC_Analytics.js at line 446
                        CubeGrid.createRowHeaderBars(_1=>undef) CubeGrid.createChildren() ListGrid.prepareForDraw() Class.invokeSuper(_1=>null, _2=>"prepareForDraw", _3=>undef, _4=>undef, _5=>undef, _6=>undef, _7=>undef, _8=>undef, _9=>undef, _10=>undef) Class.Super(_1=>"prepareForDraw", _2=>Obj{length:0}, _3=>undef) CubeGrid.prepareForDraw() ListGrid.draw(_1=>undef, _2=>undef, _3=>undef, _4=>undef) ** recursed on Class.invokeSuper
                        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
                        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
                        at java.lang.reflect.Constructor.newInstance(Unknown Source)
                        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
                        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(Unknown Source)

                        </code>

                        And here are the RPC information on developer console:


                        REQUEST 1:

                        {
                        "dataSource":"ingresos",
                        "operationType":"fetch",
                        "operationId":"serieIngresosFetch",
                        "data":null,
                        "showPrompt":true,
                        "oldValues":null,
                        "requestId":"ingresos$62720"
                        }

                        RESPONSE 1:

                        [
                        {
                        data:[
                        {
                        nombreSerieIngreso:"DESARROLLO",
                        serieIngreso:2
                        },
                        {
                        nombreSerieIngreso:"SISTEMAS",
                        serieIngreso:3
                        }
                        ],
                        endRow:2,
                        invalidateCache:false,
                        isDSResponse:true,
                        operationType:"fetch",
                        queueStatus:0,
                        startRow:0,
                        status:0,
                        totalRows:2
                        }
                        ]

                        REQUEST 2:

                        {
                        "dataSource":"ingresos",
                        "operationType":"fetch",
                        "operationId":"ofertaIngresosFetch",
                        "data":null,
                        "showPrompt":true,
                        "oldValues":null,
                        "requestId":"ingresos$62721"
                        }

                        RESPONSE 2:

                        [
                        {
                        data:[
                        {
                        tituloOferta:"1",
                        ofertaID:1
                        },
                        {
                        tituloOferta:"1",
                        ofertaID:2
                        },
                        {
                        tituloOferta:"2",
                        ofertaID:3
                        }
                        ],
                        endRow:3,
                        invalidateCache:false,
                        isDSResponse:true,
                        operationType:"fetch",
                        queueStatus:0,
                        startRow:0,
                        status:0,
                        totalRows:3
                        }
                        ]

                        REQUEST 3:

                        {
                        "dataSource":"ingresos",
                        "operationType":"fetch",
                        "operationId":"mesIngresosFetch",
                        "data":null,
                        "showPrompt":true,
                        "oldValues":null,
                        "requestId":"ingresos$62722"
                        }

                        RESPONSE 3:

                        [
                        {
                        data:[
                        {
                        mes:"February"
                        },
                        {
                        mes:"March"
                        },
                        {
                        mes:"May"
                        }
                        ],
                        endRow:3,
                        invalidateCache:false,
                        isDSResponse:true,
                        operationType:"fetch",
                        queueStatus:0,
                        startRow:0,
                        status:0,
                        totalRows:3
                        }
                        ]

                        It looks like the problem is that the cubegrid has problems fetching the datasource because it does not appear on the RPC tab in developer console.

                        Hope this info could help us find the problem.

                        Thanks in advance and lookting forward your answer.

                        Pablo

                        Comment


                          #13
                          If the RPC tab does not show the requests you probably just forgot to check "Track RPCs".

                          Your facets and valueProperty:

                          Code:
                          advancedCube.setRowFacets("serie","oferta");
                          advancedCube.setColumnFacets("mes");
                          advancedCube.setValueProperty("_value");
                          .. are totally unrelated to the data you are actually returning. The field names in the data and the facets and valueProperty need to be the same - the CubeGrid cannot magically tell what you meant :)

                          Comment


                            #14
                            Hi isomorphic,

                            I create 3 facets with ids serie, oferta and mes and i populate each facet with the values from their respective fetchdata operation.

                            When i define the row facets, column facets and value property, i indicate the id of the facet i want to use in the cubegrid.

                            is that correct?

                            In relation with the rpc info, i get the rpc info from the developer console of the three first fetch data operations that i use to populate the facets values, but the rpc tab doesnt show the fetch operation of the cubegrid, so i think there is the problem.

                            Hope you could help me. Thanks in advance,

                            Pablo

                            Comment


                              #15
                              Providing facetValues via separate DataSource fetches is fine.

                              Somehow you are causing the CubeGrid to try to render data before it fetches. Please show the complete code for doing the fetches and constructing the CubeGrid - be sure to either attach it as a file or use [ code ] tags properly.

                              Comment

                              Working...
                              X