[aida] Ajax action handlers

Janko Mivšek janko.mivsek at eranova.si
Thu Jan 29 18:54:29 CET 2009


Eli Green pravi:

> I was thinking about this recently and rather than patch into the normal event / action system, why not let people pass blocks to onClickUpdate?
> 
> e addButton: 'Add New Object' onClickUpdate: objectList do: [objectList add: newObject].

This is interesting idea and callbacks here probably won't hurt basic
MVC separation we have with action methods.
> 
> From Aida's point of view, I think this should be easier since it's a callback that you can store as an instance variable of the element. Yay! Now, this is more complicated on the client side than I had first hoped because I realized that it would mean emitting code that marshaled all the form elements on the page into a JSON request. But we should know about all the form fields, shouldn't we? Does Scriptaculous make it easy to pass form parameters as JSON?

Yes, Prototype has a nice support for Ajax form posting, which is not
much more than already supported Ajax field posting in Aida
(#onChangePost etc)

> Basically I would like the above code to work with or without javascript and I think it's an achievable goal. If you omit the onClickUpdate: parameter, it would obviously just be a form post.
> 
> I'm sad to say that I won't be using Aida for my current project - not because I think it won't do it but because my inexperience makes me nervous about billing a client for me to learn a new framework. I'm going to stay on the list and try to play with it more because I think there's a great deal of potential here.

And we'll try to provide more examples of real apps to learn from. A
code of new Aida website together with short description will be the first.

> To be honest, I'm a little hazy on the technical and philosophical differences between a WebElement, WebComponent and WebApplication.

First, those names and concepts are evolving and we are still learning
to find the best approach. Specially concerning WebComponent. While
WebApplication, besides the funny name, seems quite a successful concept.

You can continue with your thoughts, I'm all ears :)

Janko

> On Tuesday, January 27, 2009, at 04:39PM, "Janko Mivšek" <janko.mivsek na eranova.si> wrote:
>> Hi Eli,
>>
>> Your perspective is welcome and also not far away from thinking we
>> already did so far. And form posting from standalone components is high
>> on the list.
>>
>> You propose to add handling of Ajax events in a manner like the
>> exceptions are handled in Smalltalk. And to add the handling to the
>> WebElement. We are currently more inclined to add stronger support to
>> WebComponent instead and (at least for now) not handling events like
>> exceptions. Mostly because experience shows that exception handling is
>> hard for an usual programmer and therefore rarely used.
>>
>> But introduction of action methods to WebComponents, that's something
>> worth looking at. Ok, then there will be a problem of double
>> implementation of essentially the same in apps and components, but this
>> could be resolved later. What I'd like to add soon is form posting from
>> standalone components, Ajax style. We can achieve a lot just with that!
>>
>> Your example bellow also shows the problem of parameter passing via Ajax
>> requests. So far only strings are supported and you need to compose and
>> decomose them manually. General object passing would be nice of course,
>> by value or maybe even by reference?
>>
>> Best regards
>> Janko
>>
> _______________________________________________
> Aida mailing list
> Aida na aidaweb.si
> http://lists.aidaweb.si/mailman/listinfo/aida

-- 
Janko Mivšek
Svetovalec za informatiko
Eranova d.o.o.
Ljubljana, Slovenija
www.eranova.si
tel:  01 514 22 55
faks: 01 514 22 56
gsm: 031 674 565


More information about the Aida mailing list