Thursday, December 2, 2010

New and improved EventDelegator with InViewEdit demo

In may 2010, I posted about server side event delegation. The demoapp was from my (current) point of view very messy and hard to use for any other purpose than the demo.

I've improved the EventDelegator code at work, and made it more general purpose. The client side script can be used for event delegation in the browser, or if you want to, use it in combination with server side event delegation.

On the client side, you should be able to delegate most events (I haven't implemented onChange).

This demoapp implements the same functionality as the previous, with a couple of additions. There's an edit icon on every editable area. When you click to edit a name, the field gets focus. If you press escape while in the field, the edit is cancelled, same as if you click the cancel button. The code is also a lot better documented through comments.

Here's the video from the previous app:

A screenshot from the new demoapp:

>> Download Demoapp


Kathy said...

Hi Tommy

I was able to get it to work with the new version - thanks.
It really is great and like I said exactly what I was looking for.

I am now struggling with multiple instances on the same page.
I have four views showing information on one xpage.

As the code uses ids to identify and refresh I cannot have multiple instances items that are accessed/updated by their id or variable name.
This is my limitation of understanding the code and concepts that you use rather than any dig at the code.
Not sure if I could replace the ids with classes but might give it a go when I have some spare time.

I might have to go back to a not so funky non-inline editing option ***sigh**

Keep up the fantastic work - I have found and learnt so many helpful things from your site. I admire your dedication to the cause!


Tommy Valand said...

There shouldn't be any problems with multiple views/ids.

If you want to send me a demoapp, I can probably take a look at it sometimes this week.

Thanks for the kind words btw. :)