Best practice: what actions in form callback: vs. in onChange: | onClick: | on...

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

Best practice: what actions in form callback: vs. in onChange: | onClick: | on...

Sophie424
Some actions have fairly clear places e.g. if they need form values, or a
rendering canvas or script to write on.

Other actions like model updates I am able to locate in many different
places.

As good design, what kinds of actions should be done in <A> vs. <B> below?
e.g.
    html select
        ...
        callback: [:val |  <A> ]
        onChange: (html updater
            ...
            callback:[ <B> ])

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: Best practice: what actions in form callback: vs. in onChange: | onClick: | on...

Lukas Renggli
> As good design, what kinds of actions should be done in <A> vs. <B> below?
> e.g.
>     html select
>         ...
>         callback: [:val |  <A> ]
>         onChange: (html updater
>             ...
>             callback:[ <B> ])

I guess that depends on your actual problem.

Value callbacks like <A> mostly just call a write accessor to assign the value.

Lukas

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

Re: Best practice: what actions in form callback: vs. in onChange: | onClick: | on...

John Thornborrow
In reply to this post by Sophie424
Semantically, that entirely depends on if you want the page to refresh
or not i.e. submit via normal post/get or via XmlHTTPRequest - but you
"should" accommodate for both scenarios in case the user agent does not
have JavaScript functionality.

John

itsme213 wrote:

> Some actions have fairly clear places e.g. if they need form values, or a
> rendering canvas or script to write on.
>
> Other actions like model updates I am able to locate in many different
> places.
>
> As good design, what kinds of actions should be done in <A> vs. <B> below?
> e.g.
>     html select
>         ...
>         callback: [:val |  <A> ]
>         onChange: (html updater
>             ...
>             callback:[ <B> ])
>
> Thanks - Sophie
>
>
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


Pinesoft Computers are registered in England, Registered number: 2914825. Registered office: 266-268 High Street, Waltham Cross, Herts, EN8 7EA



This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com

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