Hi,
I think there is a bug in Seaside. I run into this when using JQGrid. Code in Pharo3: Dictionary>>jsonOn: aRenderer aRenderer object: [ self keysAndValuesDo: [ :key :value | aRenderer key: key value: value ] ] aRenderer is iOf GRPharoUtf8CodecStream GRPharoUtf8CodecStream does not understand object: You can reproduce it also when running JQGrid example. Have a look in the Network response in the internet browser where you will see a 500 internal server error with "MessageNotUnderstood: GRPharoUtf8CodecStream>>object: Your request could not be completed. An exception occurred." or implement GRPharoUtf8CodecStream>>object: anObject self halt. In Pharo2, it was implemented like this: Dictionary>>jsonOn: aStream JSJsonStream encodeDictionary: self on: aStream Sabine |
On Fri, Jan 24, 2014 at 12:02 PM, Sabine Knöfel
<[hidden email]> wrote: > Hi, > > I think there is a bug in Seaside. > I run into this when using JQGrid. > > Code in Pharo3: > > Dictionary>>jsonOn: aRenderer > aRenderer object: [ > self keysAndValuesDo: [ :key :value | > aRenderer key: key value: value ] ] > > aRenderer is iOf GRPharoUtf8CodecStream > GRPharoUtf8CodecStream does not understand object: The argument to #jsonOn: should be a WAJsonCanvas and not a GRPharoUtf8CodecStream in Seaside 3.1. Do you have a stack trace? > You can reproduce it also when running JQGrid example. > Have a look in the Network response in the internet browser where you will > see a 500 internal server error with "MessageNotUnderstood: > GRPharoUtf8CodecStream>>object: > Your request could not be completed. An exception occurred." > > or implement > > GRPharoUtf8CodecStream>>object: anObject > self halt. > > In Pharo2, it was implemented like this: > Dictionary>>jsonOn: aStream > JSJsonStream encodeDictionary: self on: aStream That was Seaside 3.0. JSON support in Seaside 3.1 is "new". It's no longer based on JavaScript (JSON isn't actually a JavaScript subset). It now has a canvas much like the HTML and XML support. This allowed us to fix many corner case bugs. Cheers Philippe _______________________________________________ seaside-dev mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev |
Hi Phillippe, how do I get a stack trace? "Fuel out Stack" in the Debugger? jsonOn: is sent in this context: JQGrid>>processSearchCallback
|searchRequest searchResponse| searchRequest := JQGridSearchRequest parseFromWARequest: self requestContext request using: jqGridColumns.
searchResponse := searchCallback value: searchRequest value: jqGridColumns. searchResponse jqGridColumns: jqGridColumns.
self requestContext respond: [:response| response doNotCache;
contentType: (WAMimeType applicationJson charset: self requestContext handler charSet). searchResponse jsonOn: response stream].
regards Sabine On Sat, Jan 25, 2014 at 4:34 PM, Philippe Marschall [via Smalltalk] <[hidden email]> wrote:
|
On Sun, Jan 26, 2014 at 7:45 PM, Sabine Knöfel <[hidden email]> wrote:
> Hi Phillippe, > > how do I get a stack trace? > "Fuel out Stack" in the Debugger? > > jsonOn: is sent in this context: > > JQGrid>>processSearchCallback > |searchRequest searchResponse| > searchRequest := JQGridSearchRequest parseFromWARequest: self requestContext > request using: jqGridColumns. > searchResponse := searchCallback value: searchRequest value: jqGridColumns. > searchResponse jqGridColumns: jqGridColumns. > self requestContext respond: [:response| > response > doNotCache; > contentType: (WAMimeType applicationJson > charset: self requestContext handler charSet). > searchResponse jsonOn: response stream]. Can you try this: JQGrid>>processSearchCallback | searchRequest searchResponse | searchRequest := JQGridSearchRequest parseFromWARequest: self requestContext request using: jqGridColumns. searchResponse := searchCallback value: searchRequest value: jqGridColumns. searchResponse jqGridColumns: jqGridColumns. self requestContext respond: [ :response | response doNotCache; contentType: (WAMimeType applicationJson charset: self requestContext handler charSet). response stream json: searchResponse ] Cheers Philippe _______________________________________________ seaside-dev mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev |
Hi Phillipe, thank you, this works. The JQGrid Example does work also with this. I fixed it and added it to smalltalkhub. Sabine On Sun, Jan 26, 2014 at 9:10 PM, Philippe Marschall [via Smalltalk] <[hidden email]> wrote:
|
Free forum by Nabble | Edit this page |