I'm working on taking this dhtml component here:

http://www.dhtmlgoodies.com/scripts/dhtmlgoodies-week-planner/ dhtmlgoodies-week-planner.html

and moving it into tapestry. It is heavy on javascript, AJAX and somewhat less so on PHP. The javascript has many event hooks which fire off AJAX requests to it's PHP backend.

My question is, what is the best strategy for moving to Tapestry?

I think the quickest and dirtiest solution is to create an engine service for each of the AJAX calls, which replicate what the PHP does in it's current incarnation. This does feel like the wrong way to do it though, especially since in each service, I will need to add state, while leaving the page's .java virtually empty. I'll also need to put in raw URL's to the AJAX services, directly inside the javascript.

So, knowing there must be a better way, I've been trying to figure out how I can leverage the new stuff in 4.1 to do the job. The javascript events in the planner are not straightforward - they are calculated, and if necessary, an AJAX call is made. I'm not sure if an EventListener can be made to monitor a complex event like that, or if you can make a custom event to which an EventListener can listen.

So if I can dip into specifics, I know I can get the planner to load all the "appointments" for a week pretty easily. But how to deal with an appointment move? A resize (change in duration)? A delete? A double click for an edit? Each of these has the additional problem that they can be made on the fly, and there can be many of them. How much of this can be moved in to a @Script? I'm of course aiming to have each of the listener impl methods in my Planner class, backing Planner.page and Planner.html, which will have the planner from dhtmlgoodies inside.

So does anyone have any suggestions on which road to go down? I know my quick and dirty will work, but I'm not sure if this second approach will work, nor how much time it will take, but it seems like it is closer to "the right way to do it". What is the right way?

Thanks,

J

--
Julian Wood <[EMAIL PROTECTED]>

Software Engineer
Teaching & Learning Centre
University of Calgary

http://tlc.ucalgary.ca


Reply via email to