Announcement

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

    FetchMode.LOCAL neglects criteria.

    Hello,

    I think there is a regression in one of the last SmartGWT Power builds. It is happening in 06-30-2011 build.

    This is what happens:

    I have a listgrid, that I want to run using a certain Criteria:
    Code:
    ListGrid grid = new ListGrid();
    grid.setDataSource(recipDs);
    grid.setAlternateRecordStyles(true);
    grid.setCellHeight(22);
    grid.setDataSource(recipDs);
    grid.setAutoFetchData(false);
    grid.setDataFetchMode(FetchMode.LOCAL); 
    grid.setHeight(250);
    
    grid.setFields(gridFields);
    Criteria recipCrit = new Criteria();
    recipCrit.setAttribute("CourseEdition_id", 1);
    grid.fetchData(recipCrit);
    My particular call to the server looks as follows.
    Code:
    === 2011-07-04 12:31:27,746 [l0-7] DEBUG RPCManager - Request #1 (DSRequest) payload: {
        criteria:{
        },
        operationConfig:{
            dataSource:"CourseEdition_students_Student",
            operationType:"fetch",
            textMatchStyle:"exact"
        },
        componentId:"isc_ListGrid_5",
        appID:"builtinApplication",
        operation:"CourseEdition_students_Student_fetch",
        oldValues:null
    }
    === 2011-07-04 12:31:27,747 [l0-7] DEBUG AppBase - [builtinApplication.CourseEdition_students_Student_fetch] No userTypes defined, allowing anyone access to all operations for this application
    === 2011-07-04 12:31:27,747 [l0-7] DEBUG AppBase - [builtinApplication.CourseEdition_students_Student_fetch] No public zero-argument method named '_CourseEdition_students_Student_fetch' found, performing generic datasource operation
    === 2011-07-04 12:31:27,748 [l0-7] INFO  SQLDataSource - [builtinApplication.CourseEdition_students_Student_fetch] Performing fetch operation with
    	criteria: {SaasCustomer_id:1}	values: {SaasCustomer_id:1}
    === 2011-07-04 12:31:27,749 [l0-7] INFO  SQLDataSource - [builtinApplication.CourseEdition_students_Student_fetch] derived query: SELECT $defaultSelectClause , (users.username IS NOT NULL) as userAccount FROM CourseEdition_students_Student INNER JOIN Student ON CourseEdition_students_Student.Student_id = Student.Student_id 
          INNER JOIN CourseEdition ON CourseEdition_students_Student.CourseEdition_id = CourseEdition.CourseEdition_id 
          LEFT OUTER JOIN users ON Student.Student_id = users.Student_id WHERE $defaultWhereClause
    === 2011-07-04 12:31:27,757 [l0-7] DEBUG PoolableSQLConnectionFactory - [builtinApplication.CourseEdition_students_Student_fetch] Returning pooled Connection
    === 2011-07-04 12:31:27,757 [l0-7] INFO  SQLDriver - [builtinApplication.CourseEdition_students_Student_fetch] Executing SQL query on 'Mysql': SELECT CourseEdition.startDate, Student.phone, Student.sofinummer, Student.street, Student.surname, CourseEdition.endDate, Student.city, Student.archived, Student.voorletter, Student.cellphone, Student.birthdate, Student.gender, CourseEdition.published, Student.number_addition, CourseEdition.percentageOfSubscriptions, CourseEdition.editionName, CourseEdition_students_Student.students_id, Student.tussenvoegsel, Student.number, Student.firstname, Student.postcode, CourseEdition.lmsAccess, Student.country, CourseEdition.MoodleCourse_id, CourseEdition.Status, Student.email, Student.birthplace, Student.Moodle_id, Student.active , (users.username IS NOT NULL) as userAccount FROM CourseEdition_students_Student INNER JOIN Student ON CourseEdition_students_Student.Student_id = Student.Student_id 
          INNER JOIN CourseEdition ON CourseEdition_students_Student.CourseEdition_id = CourseEdition.CourseEdition_id 
          LEFT OUTER JOIN users ON Student.Student_id = users.Student_id WHERE ('1'='1')
    === 2011-07-04 12:31:27,775 [l0-7] INFO  DSResponse - [builtinApplication.CourseEdition_students_Student_fetch] DSResponse: List with 48 items
    If I outcomment the setDataFetchMode line, it works. But I do need all records though, since it is for a mail-merge feature, and I need to send _all_ records an email. With the setDataFetchMode in place, the grid just stays empty, eventhough 48 rows were found in the MySQL Table, AND the criteria is not propagated.

    Could you guys look into this, or tell me what I am missing? This used to work in an earlier nightly, and happens since a week or two.

    #2
    This feature appears to be working fine in a quick test, let us know if you find more details that would allow us to reproduce the issue.

    Comment


      #3
      Hmm I pretty much stripped the issue down as much as I could (hardcoded criteria for instance), but here is also the operationBinding in place:

      Code:
        <operationBindings> 
          <operationBinding requiresRole="ROLE_USER" requiresAuthentication="true" operationType="fetch" 
          customValueFields="students_id, editionName,startDate,endDate,published,Status,percentageOfSubscriptions,lmsAccess,MoodleCourse_id,firstname,tussenvoegsel,surname,voorletter,birthdate,birthplace,gender,sofinummer,street,number,number_addition,postcode,city,country,phone,cellphone,email,active,archived,Moodle_id" 
          customCriteriaFields="students_id, editionName,startDate,endDate,published,Status,percentageOfSubscriptions,lmsAccess,MoodleCourse_id,firstname,tussenvoegsel,surname,voorletter,birthdate,birthplace,gender,sofinummer,street,number,number_addition,postcode,city,country,phone,cellphone,email,active,archived,Moodle_id" 
          outputs="students_id, editionName,startDate,endDate,published,Status,percentageOfSubscriptions,lmsAccess,MoodleCourse_id,firstname,tussenvoegsel,surname,voorletter,birthdate,birthplace,gender,sofinummer,street,number,number_addition,postcode,city,country,phone,cellphone,email,active,archived,Moodle_id"> 
            <selectClause>$defaultSelectClause , (users.username IS NOT NULL) as userAccount</selectClause>  
            <tableClause>CourseEdition_students_Student 
              INNER JOIN Student ON CourseEdition_students_Student.Student_id = Student.Student_id 
              INNER JOIN CourseEdition ON CourseEdition_students_Student.CourseEdition_id = CourseEdition.CourseEdition_id 
              LEFT OUTER JOIN users ON Student.Student_id = users.Student_id
            </tableClause> 
          </operationBinding>  
      </operationBindings>
      It does some joins, could that be somehow the issue (don't think so though)? it should pickup the criteria due to absence of <whereClause> tags. Also, again, removing the fetchDataMode line actually does make it send the criteria.

      Anyway, hope this helps. Using MySQL.

      Some specs:
      - Mac OS X 10.6.8
      - Firefox 5.0
      - GWT 2.3.0
      - SmartGWT Power nightly 06-30-2011
      Last edited by Sytematic; 6 Jul 2011, 02:12.

      Comment


        #4
        Still no way to reproduce the problem. About one of your previous comments - you understand that fetchDataMode:local causes criteria to be omitted in the server request, so that all records are loaded, so that filtering is done client-side?

        If this is what you intended, then check the RPC tab for the result your server sends back. Assuming it's not empty or otherwise obviously wrong, the problem is that client-side filtering is eliminating all the records. Specifically, the records may not have "CourseEdition_id" at all, or it may have the wrong value.

        Comment


          #5
          Ah, despite the well-chosen name of FetchMode.LOCAL I didn't quite get the feature :-).

          The thing is, I want to fetch ALL records and load it in a grid. Basically want to disable paging. It's because I add a checkbox to each row, such that ppl can 'select all' and send every row of persons data an email.

          ** edit ** :
          Alright, now I tried FetchMode.BASIC. That seems to be what i need, thanks.
          Last edited by Sytematic; 8 Jul 2011, 02:04.

          Comment

          Working...
          X