Hi,
I had this strange bug for a long time, but I was unable to isolate it and make a simple test. Here is the test :). I'am using seaside with french text. So I changed WAResponse>>initialize to use ISO-8859-1 charset so seaside diplays the accents properly. But strange behaviors happens when I use a spanNamed and a liveCallback in the same render. Usually the accentuated chars are displayed with a ?, but sometimes the text of the span itself changes and becomes the same as another span in the page. In the attached test, when you select something in the select, the 'Détruire la pièce' becomes a 'D�truire la pi�ce'. I hope this will help make seaside even better :). Florian 'From Squeak3.8 of ''5 May 2005'' [latest update: #6665] on 20 March 2006 at 3:24:15 pm'! WAComponent subclass: #WATestLiveSelect instanceVariableNames: 'confirmRoomDeletion room' classVariableNames: '' poolDictionaries: '' category: 'FoilFoil'! !WATestLiveSelect methodsFor: 'as yet unclassified' stamp: 'FM 2/16/2006 13:01'! initialize self session registerObjectForBacktracking: self.! ! !WATestLiveSelect methodsFor: 'as yet unclassified' stamp: 'FM 3/20/2006 15:24'! renderContentOn: html | rooms | rooms := { 1 . 2 . 3 . 4 . 5 }. room ifNil: [ room := rooms at: 1 ]. html form: [ html spanNamed: 'test' with: [ html text: 'Détruire la pièce'; space]. html selectFromList: (1 to: (rooms size)) selected: room callback: [:i | room := i] labels: [:i | i displayString] liveCallback: [:i :h | confirmRoomDeletion = false. self renderContentOn: h]. html break. html submitButtonWithAction: [ confirmRoomDeletion := true. ] text: 'Ok'. ]! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! WATestLiveSelect class instanceVariableNames: ''! !WATestLiveSelect class methodsFor: 'as yet unclassified' stamp: 'FM 2/16/2006 13:01'! canBeRoot ^ true! ! !WATestLiveSelect class methodsFor: 'as yet unclassified' stamp: 'FM 2/16/2006 13:01'! initialize (self registerAsApplication: 'testLiveSelect') ! ! WATestLiveSelect initialize! _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
> So I changed WAResponse>>initialize to use ISO-8859-1 charset so
seaside diplays > the accents properly. Florian, Depending on which version of SeasideAsync you are using, you will have to look also at #urlForLiveRequest: or #evaluateWithArgument: These methods are also setting the content type. On the other hand, I do not understand why you need to specify ISO-8859-1 since UTF-8 is able to encode everything. HTH Michel. _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Thanks for the advice, it is working well!
I just dislike the fact that the charset is defined in different places. Usually you want to use only one charset for your whole web app. I specify ISO-8859-1 because with it, my accents show up instead of ugly '?'. And by experience, with UTF-8 I get thoses '?'. But anyway, thanks for the help ! Florian Bany, Michel wrote: >> So I changed WAResponse>>initialize to use ISO-8859-1 charset so > seaside diplays >> the accents properly. > > Florian, > > Depending on which version of SeasideAsync you are using, you will have > to > look also at #urlForLiveRequest: or #evaluateWithArgument: > These methods are also setting the content type. > > On the other hand, I do not understand why you need to specify > ISO-8859-1 since > UTF-8 is able to encode everything. > > HTH > Michel. > Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Florian Minjat a écrit :
> I just dislike the fact that the charset is defined in different > places. Usually you want to use only one charset for your whole web app. > Yes, I agree. I think this should be refactored so that the encoding is supplied by the WASession object. Then we would only have to subclass rather than hacking around. _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |