[Seaside] nested LiveCallbacks
m.bany at wanadoo.fr
Fri Oct 28 08:16:45 UTC 2005
Juan Burella a écrit :
> Using this version it works in a different way but not
> completely right. When the second list is selected everything works
> fine, but then the first one is selected, it disappears leaving only
> the second and the third visible.
I think I can see what's wrong.
The original implementation of live update allowed for updating only one
area of the html document.
With you test case you need to live-update two areas, provinceSelector
therefore the original implementation cannot work.
The implementation in Seaside2.5b8-mb.14 allows you to live-update an
arbitrary number of
areas of the html document. For detecting all the areas, i.e. all the
html tags with the id= attribute,
the new implementation uses the DOM feature of XMLHttpRequest. However,
this DOM feature
is very strict and requires that the html produced by the live update
blocks is clean XML. That's why
the new implementation sets the content-type to 'text/xml;
charset=utf-8' and replaces all occurences
Your test case introduces an additional difficulty. The html produced by
the first live update callback
creates something that contains
The occurence of the ampersand (&_k=) makes this html unclean XML that
cannot be parsed
displaying whatever is received
rather than selectively updating the document. Not sure I am explaining
I tried to have the ampersand encoded so that the html creates something
With this encoding the html created becomes compliant with XML and is
properly parsed by XMLHttpRequest.
However, this does not work because the browser does not decode "&"
back to an ampersand
before sending the URL to Seaside and Seaside gets lost.
More information about the Seaside