[Seaside] Help with dependent components.

Lukas Renggli renggli at gmail.com
Sun May 9 08:03:45 UTC 2010


> I have implemented the following use case using Javascript and ASP.net:

ASP.net?

> The solution entails setting up a publish/subscribe pattern - the textbox
> and listbox B suscribe from a publisher that watches for changes on listbox
> A.
>
> I have looked at Announcements, and envision a possible solution using
> Announcements.

I suggest that you implement some model for your form fields that
models the dependencies between each other and know how to update
themselves. Magritte could be a good starting point here.

> However, a server trip seems to be inevitable with the callbacks (apart from
> the listbox B AJAX contents); also, if more than one callback is involved,
> they are sequentially executed at the server. The requirement suggests that
> this should operate at the client without server trip.

This is not true. Multiple AJAX callbacks can (and always should) be
combined into one single request. Combining callbacks into one request
does not only guarantee a deterministic execution order, but is also
ways faster than multiple requests. One should never trigger two AJAX
requests after each other, that always leads to serious problems.

> is an incorrect version of two views of gender which should ideally be
> synchronized. However the callbacks execute sequentially, while the closure
> in the dropdown obtains previous values, an do not see the new value set by
> the callback of the radioButton.

I do not understand what you mean by sequentially and how this is
related to the above? If you write the same field with two callbacks
they will inevitably override each other. That has nothing to do with
AJAX or Seaside. You probably need to somehow capture the state of
these two fields independently, and merge the input into your model.

> I would like suggestions on how to approach this common use case. There are
> many such cases while implementing a complex 1003 form.

What is a 1003 form?

Lukas

-- 
Lukas Renggli
www.lukas-renggli.ch


More information about the seaside mailing list