accessing event information

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

accessing event information

Chris Muller-4
I am still learning.  I want to make a desktop-like app in the
browser.  Seaside lets me use Ajax to respond to individual widget
clicks and update my model in the server, as well as update the DOM in
the client accordingly, all in one step:

        html button
            onClick: ((html jQuery: #idOfElementToReplace) load
                html:
                    [ : resultOfClickHtml | model doTheAppropriateUpdates.
                    resultOfClickHtml render: model ]);
            with: 'click to update the model'.

I also tested onMouseOver: and onMouseOut:, they worked.  It feels a
little strange to be updating my model within html rendering, but it
gives me near desktop-app-like development capability for the browser
with efficient event / response transfer, using Seaside.  Wonderful!

I also need to handle onKeyUp and onKeyDown:, but I'm not sure the
proper way to access the Event information by this approach.  I
couldn't find any examples I could learn from.  How could I do it?
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: accessing event information

Mariano Martinez Peck
Hi Chris, I did NOT test it but maybe something like this works?

onKeyUp: (' alert(evt) ' asFunction: #('evt'))

Basically, you can write whatever function (here I do a simple alert).

Cheers,

On Thu, Oct 1, 2015 at 12:50 AM, Chris Muller <[hidden email]> wrote:
I am still learning.  I want to make a desktop-like app in the
browser.  Seaside lets me use Ajax to respond to individual widget
clicks and update my model in the server, as well as update the DOM in
the client accordingly, all in one step:

        html button
            onClick: ((html jQuery: #idOfElementToReplace) load
                html:
                    [ : resultOfClickHtml | model doTheAppropriateUpdates.
                    resultOfClickHtml render: model ]);
            with: 'click to update the model'.

I also tested onMouseOver: and onMouseOut:, they worked.  It feels a
little strange to be updating my model within html rendering, but it
gives me near desktop-app-like development capability for the browser
with efficient event / response transfer, using Seaside.  Wonderful!

I also need to handle onKeyUp and onKeyDown:, but I'm not sure the
proper way to access the Event information by this approach.  I
couldn't find any examples I could learn from.  How could I do it?
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



--

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