[Seaside] Form extended with ajax and callbacks

Ryan Simmons ryan.craig.simmons at gmail.com
Fri Dec 2 18:19:21 UTC 2011

Here are a few things you could try.

1. Move the select outside the form. Because it is serialized with ajax it
should be fine.
2. Remove the select using javascript in a onClick event on the submit
button, something like onClick: ((html jQuery id: selectId) remove; return:
3. Use ajax to serialize the form elements by giving them a common class
and using a standard button with a
onClick: ((html jQuery ajax
    serialize: (html jQuery: '.commonCssClass');
    Script: [:s | s callback: [current callback on submit button]
On Dec 2, 2011 7:36 PM, "Norbert Hartl" <norbert at hartl.name> wrote:

> Am 02.12.2011 um 18:25 schrieb Paul DeBruicker:
> > On 11-12-02 09:21 AM, Norbert Hartl wrote:
> >> Ok, I've found the problem. As it is all the same form I submit it
> twice. Once for the transfer of the select value and the second time when
> using the submit button. The select callback is triggered a second time and
> the magritte component gets resetted and that is the reason I can't see the
> value. I'm not sure what is the best solution to it. Is it possible to
> submit only a subset of the form fields? Otherwise I need to detect this
> case somehow.
> >>
> >> Norbert
> >
> >
> > Could you just make a generic textInput that stores into an inst var in
> the component whatever value you want in the class the select chooses, then
> do the instance creation and set the value once the form is submitted?
> That wouldn't work. I need only one text input because the selected class
> is the simplest one of all possible. For every other case there will be
> multiple form elements that form a new instance. So the delegating
> component needs to be agnostic of the selected instance. As it is a select
> I just switch cases and there is no need to reset the child component
> unless the selection has changed. This way it works quite ok.
> thanks,
> Norbert
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20111202/683ec879/attachment.htm

More information about the seaside mailing list