Announcement

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

    ListGrid new row not getting updated when filter criteria is on

    v9.0_2013-07-03/LGPL Development Only (built 2013-07-03)

    I have got a ListGrid with 4 fields with each field having filter enabled. During the creation of the grid I set the data properties of the grid to include the property setNeverDropUpdatedRows with value of false.

    The scenario is that the end user applies some filtering criteria on the fields to a small subset of rows. Thereafter he adds a new row which doesnt match this criteria and saves this row. The response received from server is correct but what he sees on the browser screen is that the row hasnt been updated and still shows in blue font. If he were to remove the filter criteria and look at the row in absence of filtering the row has now got the correct font and also the primary key(received as part of the server response).

    The ResultSet property of NeverDropUpdatedRows works only for rows which are updated not for new ones. Does this mean that whenever user were to enter a new row, he will be either be forced to remove the filter criteria to see his updates go through.

    Pls advise.

    #2
    Take a look at the FAQ for grids not updating automatically - it includes troubleshooting steps to find the definitive cause of the problem.

    If, after reviewing these steps and looking at the suggested diagnostics, you ultimately think the behavior you're seeing is a bug in SmartGWT, please post a minimal, ready-to-run test case demonstrating the issue.

    Comment


      #3
      Never Drop Row not working

      In my initial post I was not putting any value in the primary key column for the new row. I tried putting a value of -1 in the primary key column which then gets updated to the correct value when server response is obtained.
      At the time of creation of grid I do set NeverDropRows to true.

      ResultSet resultSetProperties = new ResultSet();
      resultSetProperties.setNeverDropUpdatedRows(true);
      grid.setDataProperties(resultSetProperties);


      Also checked that the grid drops the rows(existing and not new) under the filter criteria if the values in them are updated to mismatch the currently applied criteria.

      Basically I am not getting setNeverDropUpdatedRows to work.

      Comment


        #4
        Hi vishalsharma,

        I can't say anything about your problem, but sending a PK that then gets changed by the DB (as I suppose) is definitely not the way to go.

        If you changed your PK-fieldtype in .ds.xml from sequence to integer and give -1 as PK value, the cacheSync will do a "select ... from <table> where <PK-field> = -1" for every add-operation and find nothing, everytime.

        When using sequence it will get the seq.nextval and use that in the insert, then use that for the cacheSync (at least for oracle). Just watch in the server console.

        How is it supposed to know that the value will change in your approach?

        Best regards,
        Blama

        Comment

        Working...
        X