Multiple forms on 1 page question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple forms on 1 page question

Sophie424
Not sure if this is Seaside-specific; apologies if it is about HTML in
general.

If I have more than 1 form on a page (e.g. from multiple inPlaceEditors, or
select boxes), the user completes a form, and I take some Ajax action in one
form:

Form-1:
    onClick: (....
        triggerForm: firstFormId;
        callback: [:r | renderWithoutMessingUp: secondFormId on: r])

And on another form on the same page:

Form-2:
    onClick: (....
        triggerForm: secondFormId;
        callback: [:r | renderWithouMessingUp: firstFormId on: r])

As long as the callbacks of Form-1 does not re-render Form-2, it seems I can
submit one form without losing the open/partially edited state of the other.

Is this a reasonable and correct way to use Ajax callbacks & forms?

Thanks - Sophie



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Multiple forms on 1 page question

Lukas Renggli
> If I have more than 1 form on a page (e.g. from multiple inPlaceEditors, or
> select boxes), the user completes a form, and I take some Ajax action in one
> form:

I don't know if InPlaceEditors use a form internally, but you
certainly don't need to add one yourself.

> As long as the callbacks of Form-1 does not re-render Form-2, it seems I can
> submit one form without losing the open/partially edited state of the other.
>
> Is this a reasonable and correct way to use Ajax callbacks & forms?

Yes.

With AJAX you can even trigger multiple forms with one request. I've
never tried that, but as far as I see this should work out of the box.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside