[Seaside] Form.Element.Observer / Callback mix-up?

Lukas Renggli renggli at gmail.com
Wed Aug 8 12:07:59 UTC 2007


> The problem is that, if I declare the doSearch function at the top of
> renderContentOn:, it works as expected. But if I declare it below the
> submitButton rendering, the callback associated with the submit
> button gets fired -- and then the entire component gets rendered in
> the results area, as if the Ajax request had triggered
> #renderContentOn: instead of #renderSearchResultsOn:.
>
> I can certainly work around the issue, by declaring my little helper
> script above the form. But I'm sure I'm probably doing something
> wrong here. If there's a cleaner way of doing this, I'd love to hear
> about it -- especially if it solves the weirdness too.

Your problem has to do with the order and the way in which Seaside
evaluates callbacks.

The first thing to notice is that it doesn't make much sense (and is
not even supported by Seaside) to trigger submit-buttons from AJAX
actions. Your code works if you remove the button from the form or
instead trigger the two form elements independently without including
the button.

> I'm building a "live search" using Form.Element.Observer from
> prototype.js, which (as far as I can tell) hasn't been implemented in
> SeasideScriptaculous yet.

I am working on this.

Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch


More information about the Seaside mailing list