Announcement

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

    Unable to do filter in listgrid with fetch mode BASIC SmartGWT version 6.1-p20170905

    Hello,

    I am using list grid with fetch mode basic I want filtering using AdvancedCriteria but I am getting error as Can't get Result Set

    I am attaching a text file which includes client code and my DS file






    Client code

    display.getTextItem().addChangedHandler(new ChangedHandler() {

    @Override
    public void onChanged(ChangedEvent event) {

    String input = (String) event.getValue();
    GWT.log("Value is" + input);
    display.getProjectDetailsGrid().getDataSource().setClientOnly(true);
    //display.getProjectDetailsGrid().invalidateCache();

    AdvancedCriteria criteria = new AdvancedCriteria(OperatorId.CONTAINS,
    new Criterion[] { new Criterion(DataSourceConstant.PROJECT_CODE, OperatorId.CONTAINS, input)});
    display.getProjectDetailsGrid().filterData(criteria);

    };
    });
    }




    final DataSource datasource = DataSource.getDataSource(projectList);
    final ListGrid listGrid = new ListGrid();
    listGrid.setID(IDsConstant.PROJECT_DETAIL_GRID);
    listGrid.setStyleName("cowListGrid");
    listGrid.setDataFetchMode(FetchMode.BASIC);
    listGrid.setSelectionType(SelectionStyle.MULTIPLE);
    listGrid.setSelectionAppearance(SelectionAppearance.CHECKBOX);
    listGrid.setDataSource(datasource);
    listGrid.setFields(getProjectListGridFields());
    return listGrid;







    Projects.ds.xml
    <DataSource ID="Projects" beanClassName="com.assaabloy.cow.shared.dto.ProjectGridDto"
    serverType="hibernate" configBean="cowSessionFactory" lookupStyle="spring"
    beanFactory="org.springframework.beans.factory.BeanFactory"
    autoDeriveSchema="false" xmlns:fmt="WEB-INF/">
    <fields>
    <field name="projectId" type="int" primaryKey="true" />
    <field name="projectCode" type="text" required="true" />
    <field name="projectDesc" type="text" required="true" />
    <field name="ppof" type="boolean" />

    </fields>
    <operationBindings>
    <binding operationType="fetch">
    <customSQL>
    SELECT p.PROJECT_ID as projectId, p.PROJECTCODE as
    projectCode, p.PROJECTDESCRIPTION as projectDesc,p.PPOF as ppof FROM PROJECTS p
    WHERE
    p.COMPANY_ID= $values.companyId and p.del=0
    </customSQL>
    </binding>





    {
    dataSource:"Projects",
    operationType:"fetch",
    componentId:"project_detail_grid",
    data:{
    operator:"contains",
    criteria:[
    {
    fieldName:"projectCode",
    operator:"contains",
    value:"D"
    }
    ]
    },
    textMatchStyle:"substring",
    resultSet:[ResultSet ID:isc_ResultSet_0 (dataSource: Projects, created by: project_detail_grid)],
    callback:{
    caller:[ResultSet ID:isc_ResultSet_0 (dataSource: Projects, created by: project_detail_grid)],
    methodName:"fetchRemoteDataReply"
    },
    willHandleError:true,
    showPrompt:true,
    prompt:"Finding Records that match your criteria...",
    oldValues:{
    operator:"contains",
    criteria:[
    {
    fieldName:"projectCode",
    operator:"contains",
    value:"D"
    }
    ]
    },
    requestId:"Projects$6271",
    internalClientContext:{
    requestIndex:2
    },
    fallbackToEval:false,
    dataFetchMode:"basic",
    lastClientEventThreadCode:"INP6",
    bypassCache:true,
    dataProtocol:"getParams"
    }




    {
    affectedRows:0,
    data:"could not extract ResultSet",
    invalidateCache:false,
    isDSResponse:true,
    queueStatus:-1,
    status:-1
    }











    Attached Files
    Last edited by preeti_kanyal; 13 Mar 2018, 23:36.

    #2
    That code is completely unreadable - try putting it in CODE tags without all the formatting

    Comment


      #3
      I think now it is in readable format
      Last edited by preeti_kanyal; 14 Mar 2018, 00:01.

      Comment


        #4
        Your response from the server indicates a server-side error. For any such error, see the server-side log for details. If you are unable to solve the problem after examining the server-side logs and troubleshooting, then you need to post the server-side logs for the failing request (this is always required for server-side issues).

        Comment


          #5
          Thanks Isomorphic I need client side filtering only in list grid but when I set fetchMode to LOCAL I am not able to get data on my listgrid. there was no call to server side on page load due to which list grid was empty. Can we have client side filtering in listgrid with data coming thru datasource file. like the snippet I have shared. My data is coming through custom sql written in ds.xml file.

          Comment


            #6
            Please see previous response. You have an error coming from your server and you need to look at the server-side log.

            Comment

            Working...
            X