[Seaside] Form, serialize:, answer: and callback:

Johan Brichau johan at inceptive.be
Wed Jun 12 07:15:26 UTC 2013


On 12 Jun 2013, at 08:24, intrader <intrader at aol.com> wrote:

> It is unclear to Dan that callback does a full page refresh. Please let me
> know as I am not entirely clear, and it is possible to play with priorities
> to cause callback to behave differently.

callback priorities only determine the order of execution of callbacks when several callbacks are being serialized over a single http call.
As an application programmer, you should almost never have to deal with them. They are, in fact, hard-coded in the WACallback classes.

The difference I point to is the one between an XMLHttpRequest and an HttpRequest (which correspond to ajax callback and regular callback). Even when working with Seaside, you need to be aware of the differences. When you use an ajax callback (such as jQuery's serializeForm) the browser performs an XMLHttpRequest and the entire page will stay the same. For Seaside, that means you are 'staying in the same continuation'. Your callback merely performs some operation on the server and sends back a response that can be treated by javascript on the client side. If you are using a standard form submission callback (such as the one example here [2]), the browser performs a POST http request and expects a full page response to refresh the entire page on the client side. This is also where Seaside creates a new continuation.

The mechanism of call: and answer: [1] operates only in the context of regular callbacks. In essence, they only meaningfully execute in the context of a regular (full page) callback.

See more:
[1] http://book.seaside.st/book/components/calling/call-answer
[2] http://book.seaside.st/book/in-action/todo/forms

Hope this helps,
Johan



More information about the seaside mailing list