Announcement

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

    getSelectionProperty doesn't help with "Can't select many record" problem in listgrid

    Hi, I posted this query below to an old thread (http://forums.smartclient.com/showthread.php?t=11630) and didn't receive a response. Just in case the lack of response was due to the fact that I posted a new query on an old/"dead" post, I am reposting it here as a "new query" initiated by me. Thanks.

    ==================================

    Hi,

    We also encountered the problem/error message "Can't select many records at once. Please try work with smaller batches." and therefore read through this email a few times. However, we are unsure how to follow Isormorphic's suggestions.

    We read through the documentation for "getSelectionProperty", but we did not find it sufficiently helpful. We therfore tried a trial-and-error approach as follows:

    1) We set the setSelectionProperty to "isSelected", as follows:

    lgSelectFilesFromTree.setSelectionProperty("isSele cted");

    and then tried to set the "isSelected" attribute for a bunch (eg 1000) listgrid records. (We even tried to call the save operation). The code snippet is below:

    for (int i=0; i < 1000; i++ ) {
    ListGridRecord lg = lgSelectFilesFromTree.getRecord(i);
    lg.setAttribute("isSelected", true);
    Boolean didSave = lgSelectFilesFromTree.saveAllEdits();
    System.out.println("DidSave is " + didSave);
    }

    but the above only select a few of the 1000 records and marked them as selected; moreover, it did not seem to do any server-side save and it was slow to process. Finally, it did not return any errors, even though it did NOT update 1000 records.

    2) We also tried a series of other "tricks", such as:

    int[] testInt = new int[1000];
    for (int i=0; i < 1000; i++ ) {
    testInt[i]=i+1;
    }
    lgSelectFilesFromTree.selectRecords(testInt);

    We were hoping that it would set all 1000 records; but, it did not. It only selected a few (eg first 75 or so). Moreover, it did not return with any error to indicate that the remaining 900+ records had not been selected.

    So, could there be a bit more elaboration on how, in SmartGWT, one is supposed to both use the "paging" feature of listgrids yet still select all the records? (And, is there a reason this is not implemented by default in the paged listgrids?)

    FYI: As an aside, in our use-case-scenario, we need to allow the user to select "all 1000+ rows" (which correspond to the 1000+ client fileds that we're storing) and then based on the selection, we intend to "add" the 1000+ selected rows to another table to mark these as "selected files" for the user.

    FYI #2: An another aside, if we turned off paging (e.g., lgSelectFilesFromTree.setDataFetchMode(FetchMode.B ASIC)), then not only was the loading of the listgrid a bit slower (as expected), but the selecting of all records took quite a bit of time according to one of the developers/test-users (e.g, > 4 seconds). (It also did not display any "hourglass" icon, though really, the problem is that it wansn't "instantaneous" to begin with.)

    Any thoughts are appreciated.

    Further operational details are below:

    ========
    OS: Windows XP Pro
    IDE: MyEclipse 9.0 with Google Plugin for Eclipse (2.3.1)
    SmartGWT EE 2.4
    Browwer: Mozilla Firefox 4.0.1
    GWT SDK: 2.2
    Sun JDK 1.6.0_13
Working...
X