[Seaside] triggerFormElement: and checkboxes?

Mart-Mari Breedt breedt_m at aircom.co.za
Wed Aug 23 10:32:31 UTC 2006


Thank you. The provided patch does work. It fixes the example I posted
to you last week (The one with UpdaterTest1 and UpdaterTest2). When I
use it with check-boxes it works fine on the first go, but returns the
entire page contents in a second click of the checkbox, but this
probadly my own fault. I first tried this in a rather complex example,
and this is where I encountered the problem. I then tried to reproduce
this in a simpler example, but with no luck yet. So it is maybe just
something in my complex example that I am doing wrong, but I will look
at this a bit more and will let know as soon I figured this problem out.
(If I figure it out)

Kind regards,


-----Original Message-----
From: Lukas Renggli [mailto:renggli at gmail.com] 
Sent: 23 Augustus 2006 11:53
To: The Squeak Enterprise Aubergines Server - general discussion.
Subject: Re: RE: [Seaside] triggerFormElement: and checkboxes?

> Last week you said that the best approach to solving my problem with
> submit buttons and updaters is to add a slightly different method to
> FormElement that only serializes the input elements and that is
> internally used by
> #triggerForm. I really do not know how to do this. Will please just
> a couple of pointers?

Ok, try adding the following patch to SULibrary. I haven't tested it,
but it should work. Maybe you can confirm that?

	^ 'Form.Element.Serializers.input = function(element) {
    switch (element.type.toLowerCase()) {
      case ''submit'':
        return false; /* ignore submit buttons */
      case ''hidden'':
      case ''password'':
      case ''text'':
        return Form.Element.Serializers.textarea(element);
      case ''checkbox'':
      case ''radio'':
        return Form.Element.Serializers.inputSelector(element);
    return false;

> Thanks for all the help!

Thanks for your posts!


Lukas Renggli
Seaside mailing list
Seaside at lists.squeakfoundation.org

More information about the Seaside mailing list