Announcement

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

    fetching data into recordlist

    I am using SmartGWT Enterprise 5.1d, Chrome browser, superdev mode for debugging.

    My issue is with the following code

    Code:
    myReadingDs.fetchData(c, new DSCallback() {
                    public void execute(DSResponse response, Object rawData, DSRequest request) {
                        // Grab an array of records or a RecordList. The latter handy for searches.
                        RecordList recordList = response.getDataAsRecordList();
                        for(int i = 0; i < recordList.getLength(); i++) {
                            consoleLog(recordList.get(i).getAttribute("collectedAt"));
                        }
                    }
                });
    So far as I can tell in debugging, it throws an exception that simply states "java.lang.string cannot be cast into java.util.list". The exception actually appears in a smartgwt popup dialog. I have placed breakpoints in my code all the way up to the first line inside this code, and it never makes it past

    Code:
    myReadingDs.fetchData(c, new DSCallback() {
    I have no idea why the error is happening, as every variable leading up to this is properly initialized. Any help is appreciated!

    #2
    Hi wriley,

    the exception is happening on the server (indicated by "java.lang.string cannot be cast into java.util.list"), your DSCallback is never reached.
    Your report reads like you try client-side debugging, only.

    Best regards
    Blama

    Comment


      #3
      Got it

      The problem was actually that my datasource was expecting a string[] and i passed it just a single string object. After inserting the single string into a string[], the problem was remedied!

      Comment

      Working...
      X