Draft: serverside event handlers in eTemplate, jQuery and drag-n-drop

Im working since two weekends on how to implement drag-n-drop in
eTemplate. Christian (jaytraxx) give me the recommendation to give it a
try with jQuery (www.jquery.com).

I have now a working drag-n-drop demo running in the eTemplate editor.
Thought it’s just co-existing with eTemplate but not really supported by
eTemplate.

The plan is now to device an event-model, which allows to have
serverside event handlers, written in php, for all sort of events
(onclick, onchange, …), beside the already available (clientside)
event handlers in javascript. Drag-n-drop would then be an event emitted
by widgets marked as dragables or droppabals in eTemplate, were one
could also specify an event-handler, like you already do it eg. for
onchange.

Why using serverside eventhandlers anyway? There are many reasons, just
to name a few:

  • no need to implents things twice (once on serverside in PHP and again
    in javascript on clientside)
  • keeping the logic / control flow together in one file / class
  • hiding the implementation details of eTemplate (you dont need to know
    how eTemplate renders a certain widget or your code will still run if
    these details change)
  • To be precise: clientside eventhandlers will still be supported, and
    in some cases make more sense, compared to a serverside one. *

To do so I wrote some classes, which demonstrate what serverside
interface an event handler could use. It’s of cause not yet work, it
should only demonstrate the interface.

Anyway let me know what you think …

Ralf

Ralf Becker
Director Software Development

Stylite GmbH
[open style of IT]

Morschheimer Strasse 15
67292 Kirchheimbolanden

fon +49 (0) 6352 70629-0
fax +49 (0) 6352 70629-30
mailto: rb@stylite.de

www.stylite.de
www.egroupware.org


Geschäftsführer Andre Keller, Gudrun Müller,
Nigel Vickers und Ralf Becker
Registergericht Kaiserslautern HRB 30575
Umsatzsteuer-Id / VAT-Id: DE214280951

Hi Ralf,

Congrats that you’re one of the lucky guys having time for that. I really want to join … if I only had some time !!! Maybe after having all the SyncML stuff fixed …

Where can we have a look at the code?

Great, great, great! This thing has always been on top of my minds priority list … I’m also a friend of having things abstracted on the serverside. This produces well maintainable code. As I already said, after having the SyncML issue done I will join in.

I think, here on the list we could just clear up who’s interested in joining the development. The real development details should then be discussed directly by phone or chat with that people afterwards.

Anyway let me know what you think …

After a quick scan, the only thing I would add is the interfaces to
match, to enforce that anything that claims to be Draggable has the
onDrag(etemplate_drag_n_drop_event $e) method, Droppable has
onDrop(etemplate_drag_n_n_drop_event $e), Clickable has
onClick(etemplate_clicked_event $e), etc.

Nathan Gray
nathan at goarctic dot com


Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World™ will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge


eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

Hi Nathan,

Nathan Gray schrieb:

Anyway let me know what you think …

After a quick scan, the only thing I would add is the interfaces to
match, to enforce that anything that claims to be Draggable has the
onDrag(etemplate_drag_n_drop_event $e) method, Droppable has
onDrop(etemplate_drag_n_n_drop_event $e), Clickable has
onClick(etemplate_clicked_event $e), etc.

I dont like the idea with an interface, as it means, if I have two
buttons in a dialog, I need two classes to handle clicking on the
buttons, as an interface enforces a method name of the handler.

I prefer to have the code of a dialogue together in one class.

Ralf

Ralf Becker
Director Software Development

Stylite GmbH
[open style of IT]

Morschheimer Strasse 15
67292 Kirchheimbolanden

fon +49 (0) 6352 70629-0
fax +49 (0) 6352 70629-30
mailto: rb@stylite.de

www.stylite.de
www.egroupware.org


Geschäftsführer Andre Keller, Gudrun Müller,
Nigel Vickers und Ralf Becker
Registergericht Kaiserslautern HRB 30575
Umsatzsteuer-Id / VAT-Id: DE214280951


Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World™ will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge


eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

Hi Ralf,

I don’t have much to add to this; looks like a great and useful new
addition!
Some of the plans I have (a new app) will definitely benefit from this
(but like Cristian; I don’t have time on my side).

I still got some old code from my old (pre-AJAX) Terra-Terra project
that might be useful here; as soon as this is getting some kinda form
and I have the chance, I’ll try to help improving this.

Oscar

Im working since two weekends on how to implement drag-n-drop in
eTemplate. Christian (jaytraxx) give me the recommendation to give it a
try with jQuery (www.jquery.com).

I have now a working drag-n-drop demo running in the eTemplate editor.
Thought it’s just co-existing with eTemplate but not really supported by
eTemplate.

The plan is now to device an event-model, which allows to have
serverside event handlers, written in php, for all sort of events
(onclick, onchange, …), beside the already available (clientside)
event handlers in javascript. Drag-n-drop would then be an event emitted
by widgets marked as dragables or droppabals in eTemplate, were one
could also specify an event-handler, like you already do it eg. for
onchange.

Why using serverside eventhandlers anyway? There are many reasons, just
to name a few:

  • no need to implents things twice (once on serverside in PHP and again
    in javascript on clientside)
  • keeping the logic / control flow together in one file / class
  • hiding the implementation details of eTemplate (you dont need to know
    how eTemplate renders a certain widget or your code will still run if
    these details change)
  • To be precise: clientside eventhandlers will still be supported, and
    in some cases make more sense, compared to a serverside one. *

To do so I wrote some classes, which demonstrate what serverside
interface an event handler could use. It’s of cause not yet work, it
should only demonstrate the interface.

Anyway let me know what you think …

Ralf

Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World™ will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________ eGroupWare-developers mailing list eGroupWare-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/egroupware-developers

Oscar van Eijk


Oveas Functionality Provider
Zwaardenburg 63 – 3437 RJ Nieuwegein
T: +31(0)30 - 889 7812 – F: +31(0)30 - 889 9117
http://oveas.com – mailto:info@oveas.com

Oveas Functionality Provider

Hi Nathan,

Nathan Gray schrieb:

Anyway let me know what you think …

After a quick scan, the only thing I would add is the interfaces …

I dont like the idea with an interface, as it means, if I have two
buttons in a dialog, I need two classes to handle clicking on the
buttons, as an interface enforces a method name of the handler.

I prefer to have the code of a dialogue together in one class.

I can see how interfaces would clutter things up, since you can’t just
specify a single function to be the handler for a single action on a
single widget.

Looking forward to it, there are some things I’d like to use it for.
Unfortunately, I’m like everyone else WRT time, but I can help with
testing.

Nathan Gray
nathan at goarctic dot com


Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World™ will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge


eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers