Announcement

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

    About Calling fetchData(Criteria criteria) on ListGrid

    Dear all,

    I got a big problem and didn't know where there was wrong design in my code.

    All I want to do is Query Functionality, that is to filter records of ListGrid by a given criteria which is from DynamicForm after fetching data from server-side. But it seems to fetch data from server-side only, not filtering records by a given criteria at all.

    My code is as follows:

    DataSource listGridDS = SRDS.getInstanc("ListGrid");

    DataSource dynamicFormDS = SRDS.getInstance("DynamicForm");

    DynamicForm dynamicForm = new DynamicForm();
    dynamicForm.setDataSource(dynamicFormDS);

    SelectItem product = new SelectItem("Product");
    product.setAutoFetchData(true);

    dynamicForm.setFields(product);
    .
    .
    ListGrid listGrid = new ListGrid();
    listGrid.setDataSource(listGridDS);
    listGrid.setAutoFetchData(true);
    .
    .
    IButton queryButton = new IButton();

    queryButton.addClickHandler(new ClickHandler() {
    public void onClick(ClickEvent event) {
    listGrid.fetchData(dynamicForm.getValuesAsCriteria());
    dynamicForm.clearValues();
    }
    });

    Anyone can guide me please??
    Thx for your reply!!

    Regards,
    Jeff

    #2
    Anyone can help me please??

    Comment


      #3
      I think you want to use listGrid.setAutoFetchAsFilter(true)

      Comment


        #4
        Originally posted by holograham
        I think you want to use listGrid.setAutoFetchAsFilter(true)
        Hii holograham,

        First of all, I wanna thank for ur reply!! =)

        I've tried to add a line, "listGrid.setAutoFetchAsFilter(true);", under the line, "listGrid.setAutoFetchData(true);", in my code. But its so sad that no items to show on my listGrid instead.

        God~~ How should I do in the next???


        Regards,
        Jeff

        Comment


          #5
          Hello litsma:

          Have you checked server side to see if you queries are actually returning anydata?

          If they are working, post your datasource files and a complete sample of what you are trying to do.

          Comment


            #6
            Originally posted by paperclip
            Hello litsma:

            Have you checked server side to see if you queries are actually returning anydata?

            If they are working, post your datasource files and a complete sample of what you are trying to do.
            Hi, paperclip..

            I'm really sure that my server-side is working good.
            My java codes, Service.java, ServiceDS.java and ServiceRPC.java, are as attachment.

            What I want to do is to filter data on ListGrid with the criteria of DynamicForm after refetching data from server-side.
            That is, evey time before filtering data, the state of these data on ListGrid must ensure to be the latest.
            Hope those key .java files can help you know my design.

            Thank for guiding me again.

            Regards,
            Jeff
            Attached Files

            Comment


              #7
              Anyone know where there is wrong with my code please??
              Thank for replying me!!

              Regards,
              Jeff

              Comment


                #8
                Dear all,

                I've tried myself for several days, and something unexpected still happened with fetchData(Criteria criteria).
                I've reviewed JAVA DOC to check the usage of fetchData(Criteria criteria) for many times.

                My opinion is that the inner execution steps of fetchData(Criteria criteria) should be to refetch data from server-side at first,
                and then filter data on client-side(such as on my ListGrid) by a given criteria.

                IS MY OPINION CORRECT?


                Regards,
                Jeff

                Comment

                Working...
                X