DSRequest sending LinkedHashMap instead of String

Hi,

I’m using the spring datasource integration and I"m seeing a very bizarre problem.

In my application I have a select item that holds a set of status values. When the user hits a “search” button, the value of the status field is retrieved and used in a table fetchData() query, like this:

Object statusVal =  statusSelectItem.getValue();
if(statusVal != null) {
    if(statusVal instanceof String && !statusVal.equals("Show All")) {
        criteria.addCriteria("leadStatus", statusVal.toString());
    }
}

On the server side, I have in my dao code like this:

String status = (String)dsRequest.getFieldValue("leadStatus");
if(status != null) {
    criteria.add(Restrictions.eq("status", LeadStatus.valueOf(status.toUpperCase())));
}

When I run in the google hosted browser the value I’m passing across comes across as a String and works just fine. However, when I run anywhere outside of the hosted browser, the value comes across as a LinkedHashMap and causes a ClassCastException to be thrown.

I’m at a total loss as to explain this behavior since I can’t trace the root cause. When it works in the hosted mode all the correct data is returned and the app works great.

Any help greatly appreciated.

Thanks,
Brian

What browser is this in? If it’s in Chrome only it’s probably a widely reported core GWT bug.

Otherwise, can you show the request you see in the RPC tab of the Developer Console?

Here ya go

Sure looks mapish to me…lol


{
    actionURL:"http://localhost:8888/leadcentral/sc/IDACall", 
    showPrompt:true, 
    prompt:"Finding Records that match your criteria...", 
    transport:"xmlHttpRequest", 
    promptStyle:"dialog", 
    bypassCache:true, 
    data:{
        criteria:{
            batchId:"10001", 
            leadStatus:{
                "0":"U", 
                "1":"n", 
                "2":"m", 
                "3":"a", 
                "4":"t", 
                "5":"c", 
                "6":"h", 
                "7":"e", 
                "8":"d", 
                tI:2
            }
        }, 
        operationConfig:{
            dataSource:"leadDataSource", 
            repo:null, 
            operationType:"fetch", 
            textMatchStyle:"exact"
        }, 
        startRow:0, 
        endRow:75, 
        componentId:"isc_OID_80", 
        appID:"builtinApplication", 
        operation:"leadDataSource_fetch", 
        oldValues:{
            batchId:"10001", 
            leadStatus:{
                "0":"U", 
                "1":"n", 
                "2":"m", 
                "3":"a", 
                "4":"t", 
                "5":"c", 
                "6":"h", 
                "7":"e", 
                "8":"d", 
                tI:2
            }
        }
    }
}

Aha. This is a core GWT bug logged here - please star this issue so the GWT team gets a clearer idea of how many people are being affected.

We’re not entirely clear on what exact workaround applies - can you try new String() around your toString() call client-side. If that doesn’t seem to work, can you try the latest nightly, where we’ve made some attempts to work around this bug in JS code as well.

Actually, type casting to a String should work around the GWT bug.

String statusVal = (String)statusSelectItem.getValue();
criteria.addCriteria("leadStatus", statusVal);