Announcement

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

    Live filter with List Grid . setData throws exception and not filtering

    Hi Team,

    I am using Smart GWT 2.5. I am using List Grid and stageGrid.setShowFilterEditor(true); Everything comes fine but when i search for something nothing on front end and on developer console the following error is thrown

    12:59:46.825 [ERROR] [comparisionviewer] 12:59:46.822:INP1:WARN:ListGrid:isc_ListGrid_0:No DataSource or invalid DataSource specified, can't create data model
    Class.getStackTrace(_1=>undef, _2=>undef, _3=>undef, _4=>undef)
    Canvas.createDataModel(_1=>Obj, _2=>Obj{ID:auto_fetch}, _3=>Obj)
    Canvas.filterWithCriteria(_1=>Obj, _2=>Obj{ID:auto_fetch}, _3=>Obj)
    Canvas.$wo(_1=>"filter", _2=>Obj, _3=>null, _4=>Obj)
    Class.invokeSuper(_1=>null, _2=>"$wo", _3=>undef, _4=>undef, _5=>undef, _6=>undef, _7=>undef, _8=>undef, _9=>undef, _10=>undef)
    Class.Super(_1=>"$wo", _2=>Array[4], _3=>[object Arguments])
    ListGrid.$wo(_1=>"filter", _2=>Obj, _3=>null, _4=>Obj, _5=>undef)
    Canvas.filterData(_1=>Obj, _2=>null, _3=>Obj)
    ListGrid.handleFilterEditorSubmit(_1=>Obj, _2=>Obj)
    RecordEditor.performFilter(_1=>true)
    RecordEditor.performAction(_1=>true)
    RecordEditor.editorChanged(_1=>[TextItem ID:isc_TextItem_0 name:COUNTRY])
    [a]TextItem.changed([DynamicForm ID:isc_DynamicForm_0], [TextItem ID:isc_TextItem_0 name:COUNTRY], "U")
    FormItem.handleChanged(_1=>"U", undef, undef, undef, undef, undef, undef, undef)
    ** recursed on Class.invokeSuper

    com.smartgwt.client.core.JsObject$SGWT_WARN: 12:59:46.822:INP1:WARN:ListGrid:isc_ListGrid_0:No DataSource or invalid DataSource specified, can't create data model
    Class.getStackTrace(_1=>undef, _2=>undef, _3=>undef, _4=>undef)
    Canvas.createDataModel(_1=>Obj, _2=>Obj{ID:auto_fetch}, _3=>Obj)
    Canvas.filterWithCriteria(_1=>Obj, _2=>Obj{ID:auto_fetch}, _3=>Obj)
    Canvas.$wo(_1=>"filter", _2=>Obj, _3=>null, _4=>Obj)
    Class.invokeSuper(_1=>null, _2=>"$wo", _3=>undef, _4=>undef, _5=>undef, _6=>undef, _7=>undef, _8=>undef, _9=>undef, _10=>undef)
    Class.Super(_1=>"$wo", _2=>Array[4], _3=>[object Arguments])
    ListGrid.$wo(_1=>"filter", _2=>Obj, _3=>null, _4=>Obj, _5=>undef)
    Canvas.filterData(_1=>Obj, _2=>null, _3=>Obj)
    ListGrid.handleFilterEditorSubmit(_1=>Obj, _2=>Obj)
    RecordEditor.performFilter(_1=>true)
    RecordEditor.performAction(_1=>true)
    RecordEditor.editorChanged(_1=>[TextItem ID:isc_TextItem_0 name:COUNTRY])
    [a]TextItem.changed([DynamicForm ID:isc_DynamicForm_0], [TextItem ID:isc_TextItem_0 name:COUNTRY], "U")
    FormItem.handleChanged(_1=>"U", undef, undef, undef, undef, undef, undef, undef)
    ** recursed on Class.invokeSuper
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    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:154)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:291)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:541)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:362)
    at java.lang.Thread.run(Thread.java:680)



    //The code i am using is as follows:

    List<ListGridField> columnList = new ArrayList<ListGridField>();
    List<HeaderSpan> headerSpanList = new ArrayList<HeaderSpan>();

    ListGridField column =null;

    column = new ListGridField("COUNTRY",150);
    column.setAutoFetchDisplayMap(false);
    columnList.add(column);

    column = new ListGridField("CONTINENT",150);
    column.setAutoFetchDisplayMap(false);
    columnList.add(column);

    column = new ListGridField("AREA",150);
    columnList.add(column);

    ListGrid stageGrid = new ListGrid();
    stageGrid.setFields(columnList.toArray(new ListGridField[0]));
    stageGrid.setData(getCountryData());

    stageGrid.setHeight(200);
    stageGrid.setWidth(450);
    stageGrid.setAutoFetchData(false);

    stageGrid.setShowFilterEditor(true);
    stageGrid.setFilterOnKeypress(true);
    stageGrid.setShowRowNumbers(true);


    Canvas canvas = new Canvas();
    canvas.addChild(stageGrid);

    canvas.draw();


    and data method is

    private ListGridRecord[] getCountryData(){
    DataSource source = new DataSource();
    source.setClientOnly(true);
    List<ListGridRecord> rows = new ArrayList<ListGridRecord>();

    ListGridRecord record = null;

    record = new ListGridRecord();
    record.setAttribute("COUNTRY", "USA");
    record.setAttribute("CONTINENT", "NORTH AMERICA");
    record.setAttribute("AREA", "100");
    source.addData(record);
    rows.add(record);

    record = new ListGridRecord();
    record.setAttribute("COUNTRY", "CANADA");
    record.setAttribute("CONTINENT", "NORTH AMERICA");
    record.setAttribute("AREA", "300");
    source.addData(record);
    rows.add(record);

    record = new ListGridRecord();
    record.setAttribute("COUNTRY", "INDIA");
    record.setAttribute("CONTINENT", "ASIA");
    record.setAttribute("AREA", "50");
    source.addData(record);
    rows.add(record);

    record = new ListGridRecord();
    record.setAttribute("COUNTRY", "CHINA");
    record.setAttribute("CONTINENT", "ASIA");
    record.setAttribute("AREA", "200");
    source.addData(record);
    rows.add(record);

    }

    Can someone please help.. I am sure it should basic change

    #2
    This is bit urget to me can some take a look at it ASAP

    Comment


      #3
      Hi ISOMORPHIC ARE U AVAILABLE

      Comment


        #4
        Stop posting duplicates, that is extremely obnoxious. If you expect support from Isomorphic, commercial support plans are available.

        Comment


          #5
          Hey Team
          Sorry. I thought i did not mark the heading correctly and I posted again but not to spam

          Comment


            #6
            Is filter feature only available for only data source.. Will it not work in case of setData

            Comment


              #7
              Hi Team,
              has one seen similar issue earlier

              Thanks,

              Comment

              Working...
              X