[seaside-dev] checkbox onChange

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

[seaside-dev] checkbox onChange

hernan.wilkinson
Hi,
 if I have this code:

....
        aCanvas checkbox
            value: value;
            callback: [ :aValue | value := aValue ];
            onChange: (((aCanvas jQuery id: id) load serialize: (aCanvas jQuery this)) html: [:c | ...  ]).
....

The onChange callback is executed but the checkbox callback is not evaluated, to "value" does not change. But if I change it to

....
            onChange: (((aCanvas jQuery id: id) load serialize: (aCanvas jQuery this parent)) html: [:c | ...  ]).
....

the checkbox callback gets evaluated before the onChange callback (as expected). (note that I only added the message parent to serialize the parent of the checkbox. In the example I have, the parent is a form).

This behavior is not the same for a select. The first code works ok with a select.
Does anybody know why? It looks like serializing only the checkbox is not enought to trigger the checkbox's callback...

Thank you
Hernan.



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

Re: checkbox onChange

Lukas Renggli
> This behavior is not the same for a select. The first code works ok with a
> select.
> Does anybody know why? It looks like serializing only the checkbox is not
> enought to trigger the checkbox's callback...

Yes, see the method comment of the method #serializeThis.

JQAjax>>serializeThis
        "Serialize the receiving element. Note that this might not work for
all form elements: (1) for check-boxes and multi-select lists Seaside
internally depends on an additional hidden form element that is
generated automatically, instead use #serializeThisWithHidden (2)
submit-button callbacks are ignored, instead use a normal callback to
trigger specific code evaluation."

        self serialize: self jQuery this

Lukas

--
Lukas Renggli
www.lukas-renggli.ch
_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: checkbox onChange

hernan.wilkinson
thank you!!


On Thu, Apr 8, 2010 at 5:55 PM, Lukas Renggli <[hidden email]> wrote:
> This behavior is not the same for a select. The first code works ok with a
> select.
> Does anybody know why? It looks like serializing only the checkbox is not
> enought to trigger the checkbox's callback...

Yes, see the method comment of the method #serializeThis.

JQAjax>>serializeThis
       "Serialize the receiving element. Note that this might not work for
all form elements: (1) for check-boxes and multi-select lists Seaside
internally depends on an additional hidden form element that is
generated automatically, instead use #serializeThisWithHidden (2)
submit-button callbacks are ignored, instead use a normal callback to
trigger specific code evaluation."

       self serialize: self jQuery this

Lukas

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


_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev