zorba-the-geek / smartgwt

Automatically exported from code.google.com/p/smartgwt
0 stars 0 forks source link

DataSourceDateField in RestDataSource create an incorrect POST when do a form.saveData() #124

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. create a DynamicForm, with a DateItem on it, setName("date") it 

2. attach to a RestDataSource with a DataSourceDateField like 
DataSourceDateField("date", "Data");

3. add a button to do a  form.saveData();

4. Tomcat complain with a 400 Error, saying :
"The request sent by the client was syntactically incorrect ()."

Think the problem is the ()

Raw POST data generated

date=2009-02-17&_operationType=add&_oldValues=%7Bdate%3Anew%20Date(1234825200000
)%7D&_componentId=isc_OID_28&_dataSource=isc_OID_27

Original issue reported on code.google.com by gurub...@gmail.com on 17 Feb 2009 at 4:49

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
looked again, and found that the problem is really the format of the field 
"date"..
JSON REST "application/x-www-form-urlencoded" form post Date with a simple 
format like :

importDate=2009-02-17 .. 

instead criteria fetch to the same RestDataSource, produce uri request like
?importDate=Tue%20Feb%2003%202009%2000%3A00%3A00%20GMT%2B0100%20(CET) ... much 
better..

it's possible to implement a method to change the way Date are serializized in 
JSON
POST request ?
thanks

Original comment by gurub...@gmail.com on 23 Feb 2009 at 6:20

GoogleCodeExporter commented 9 years ago
This issue should be fixed in SVN. This is now internally controlled via 
JSONEncoder.dateFormat and JSONEncoder.encodeDate(). The default has been 
changed 
(as of about 4 months ago) to use an XML style date "2009-10-10" etc which will 
work.

Let us know if you're still having issues. If not, we'll close this issue.

Original comment by smartgwt...@gmail.com on 6 Aug 2009 at 9:20

GoogleCodeExporter commented 9 years ago
No updates from user. Closing.

Original comment by sanjiv.j...@gmail.com on 7 Aug 2009 at 9:06