Hello,
I am using smartgwt 2.4 LGPL version, and when testing under eclipse, it is fine. But if deployed as a war file to tomcat, I got strange error regarding adding data to server side via data source.
I have a listGrid, and a DynamicForm, both bound to a data source, under eclipse dev env, I can add record successful, but if deployed as war, error.
The error is the row added shown in the attachment picture, as below:
the correct result should be: user8
but what I got is:
{"0":"u","1":"s","2":"e","3":"r","4":"8","cM":{"1":1,"124":1,"125":1,"126":1}}
The main code of my data source like this:
--------------------
setID(id);
setDataFormat(DSDataFormat.XML);
setRecordXPath("//" + recordName);
DataSourceField pkField = new DataSourceField("id", FieldType.INTEGER, "id");
pkField.setHidden(true);
pkField.setPrimaryKey(true);
DataSourceField nameField = new DataSourceField("name", FieldType.TEXT, "username");
DataSourceField passwordField = new DataSourceField("password", FieldType.TEXT, "password");
DataSourceField emailField = new DataSourceField("email", FieldType.TEXT, "email");
DataSourceField roleTypeField = new DataSourceField("roleType", FieldType.TEXT, "type");
roleTypeField.setValueMap("AdminType", "UserType", "Combined");
DataSourceField versionField = new DataSourceField("version", FieldType.INTEGER, "version");
versionField.setHidden(true);
setFields(pkField, nameField, passwordField, emailField, roleTypeField, versionField);
OperationBinding fetch = new OperationBinding(DSOperationType.FETCH, fetchURL);
fetch.setDataProtocol(DSProtocol.GETPARAMS);
fetch.setDataFormat(DSDataFormat.XML);
// POST
OperationBinding add = new OperationBinding(DSOperationType.ADD, addURL);
add.setDataProtocol(DSProtocol.GETPARAMS);
add.setDataFormat(DSDataFormat.XML);
add.setRecordName(recordName);
DSRequest postDSRequest = new DSRequest();
postDSRequest.getUseSimpleHttp();
postDSRequest.setHttpMethod("POST");
add.setRequestProperties(postDSRequest);
// PUT
OperationBinding update = new OperationBinding(DSOperationType.UPDATE, updateURL);
update.setDataProtocol(DSProtocol.POSTPARAMS);
update.setDataFormat(DSDataFormat.XML);
update.setRecordName(recordName);
DSRequest putDSRequest = new DSRequest();
putDSRequest.getUseSimpleHttp();
putDSRequest.setHttpMethod("PUT");
update.setRequestProperties(putDSRequest);
// DELETE
OperationBinding remove = new OperationBinding(DSOperationType.REMOVE, removeURL);
remove.setDataProtocol(DSProtocol.POSTXML);
remove.setDataFormat(DSDataFormat.XML);
DSRequest deleteDSRequest = new DSRequest();
deleteDSRequest.getUseSimpleHttp();
deleteDSRequest.setHttpMethod("DELETE");
remove.setRequestProperties(deleteDSRequest);
dataSource.setOperationBindings(fetch, add, update, remove);
--------------------
I am using smartgwt 2.4 LGPL version, and when testing under eclipse, it is fine. But if deployed as a war file to tomcat, I got strange error regarding adding data to server side via data source.
I have a listGrid, and a DynamicForm, both bound to a data source, under eclipse dev env, I can add record successful, but if deployed as war, error.
The error is the row added shown in the attachment picture, as below:
the correct result should be: user8
but what I got is:
{"0":"u","1":"s","2":"e","3":"r","4":"8","cM":{"1":1,"124":1,"125":1,"126":1}}
The main code of my data source like this:
--------------------
setID(id);
setDataFormat(DSDataFormat.XML);
setRecordXPath("//" + recordName);
DataSourceField pkField = new DataSourceField("id", FieldType.INTEGER, "id");
pkField.setHidden(true);
pkField.setPrimaryKey(true);
DataSourceField nameField = new DataSourceField("name", FieldType.TEXT, "username");
DataSourceField passwordField = new DataSourceField("password", FieldType.TEXT, "password");
DataSourceField emailField = new DataSourceField("email", FieldType.TEXT, "email");
DataSourceField roleTypeField = new DataSourceField("roleType", FieldType.TEXT, "type");
roleTypeField.setValueMap("AdminType", "UserType", "Combined");
DataSourceField versionField = new DataSourceField("version", FieldType.INTEGER, "version");
versionField.setHidden(true);
setFields(pkField, nameField, passwordField, emailField, roleTypeField, versionField);
OperationBinding fetch = new OperationBinding(DSOperationType.FETCH, fetchURL);
fetch.setDataProtocol(DSProtocol.GETPARAMS);
fetch.setDataFormat(DSDataFormat.XML);
// POST
OperationBinding add = new OperationBinding(DSOperationType.ADD, addURL);
add.setDataProtocol(DSProtocol.GETPARAMS);
add.setDataFormat(DSDataFormat.XML);
add.setRecordName(recordName);
DSRequest postDSRequest = new DSRequest();
postDSRequest.getUseSimpleHttp();
postDSRequest.setHttpMethod("POST");
add.setRequestProperties(postDSRequest);
// PUT
OperationBinding update = new OperationBinding(DSOperationType.UPDATE, updateURL);
update.setDataProtocol(DSProtocol.POSTPARAMS);
update.setDataFormat(DSDataFormat.XML);
update.setRecordName(recordName);
DSRequest putDSRequest = new DSRequest();
putDSRequest.getUseSimpleHttp();
putDSRequest.setHttpMethod("PUT");
update.setRequestProperties(putDSRequest);
// DELETE
OperationBinding remove = new OperationBinding(DSOperationType.REMOVE, removeURL);
remove.setDataProtocol(DSProtocol.POSTXML);
remove.setDataFormat(DSDataFormat.XML);
DSRequest deleteDSRequest = new DSRequest();
deleteDSRequest.getUseSimpleHttp();
deleteDSRequest.setHttpMethod("DELETE");
remove.setRequestProperties(deleteDSRequest);
dataSource.setOperationBindings(fetch, add, update, remove);
--------------------
Comment