Announcement

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

    Submitting specific value to DB, through GUI&DS

    Hello all,

    While I'm using SmartGWT 2.4 with Google Chrome 12 or IE9 I have a use case in which I have to programmatically set a value to a record from a Datasource which is connected with the DB.

    My code sample is as follows:
    Code:
            m_ListGrid.setSortField("ListGridField");
    	ResultSet results = (ResultSet)       m_ListGrid.getDataAsRecordList();
    	Record rec = null;
    	for (int i=0;i<results.getLength();i++)
    	{
    		rec = results.get(i);
    		rec.setAttribute("ListGridField", newValue());
    		m_ListGrid.updateData(rec);
    	}
    	m_ListGrid.refreshFields();
    When I'm using this code, which is connected to an onClickEvent of a button, the m_ListGrid.updateData(rec) line throws the following exception:
    Code:
    10:16:18.588 [ERROR] [customds] 10:16:18.582:XRP9:WARN:RPCManager:java.lang.Long cannot be cast to java.lang.String, response: {operationId: "listing_tariff_system_update", clientContext: undef, context: Obj, transactionNum: 15, httpResponseCode: 200, httpResponseText: "//isc_RPCResponseStart-->[{queueStatus:-..."[170], xmlHttpRequest: [object XMLHttpRequest], transport: "xmlHttpRequest", status: -1, clientOnly: undef, httpHeaders: Obj, isStructured: true, callbackArgs: null, results: Obj, queueStatus: -1, isDSResponse: true, invalidateCache: false, data: "java.lang.Long cannot be cast to java.la..."[49]}
    com.smartgwt.client.core.JsObject$SGWT_WARN: 10:16:18.582:XRP9:WARN:RPCManager:java.lang.Long cannot be cast to java.lang.String, response: {operationId: "listing_tariff_system_update", clientContext: undef, context: Obj, transactionNum: 15, httpResponseCode: 200, httpResponseText: "//isc_RPCResponseStart-->[{queueStatus:-..."[170], xmlHttpRequest: [object XMLHttpRequest], transport: "xmlHttpRequest", status: -1, clientOnly: undef, httpHeaders: Obj, isStructured: true, callbackArgs: null, results: Obj, queueStatus: -1, isDSResponse: true, invalidateCache: false, data: "java.lang.Long cannot be cast to java.la..."[49]}
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
        at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
        at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
        at java.lang.Thread.run(Unknown Source)
    Can anyone help me with a workaround or a solution for submitting data to a record from DB programmatically, via a DS and a ResultSet as in my sample code before?

    Thank you in advance,
    Driftdone

    #2
    This appears to be a server crash, so please show the complete server log for the request (always do this).

    Comment

    Working...
    X