Thanks for the post!
I'm all for extending the scriptaculous project if there are useful
additions! can you point me to the scriptaculous documentation for these
hooks? what are they typically used for?
On Tue, May 6, 2008 at 7:40 AM, Stefan Lindner <[EMAIL PROTECTED]> wrote:
> Dear Ryan,
>
> I have implemented the Scriptaculous dragAndDrop events onStart und
> onEnd. The implementation is experimental at the moment but it works
> fine. To do a proper implementation I need to extend the
> DraggabeBehavior class. Are you interrested in a collaboration in
> development of Scriptaculous for wicket? Or should I simply generate a
> patch? The questions I want do discuss are:
>
> 1. The DraggableBehavior class has a common respond-method, currently
> commented as //no callback...yet
>
> 2. Now it would be possible to something like
>
> enum DragEventType = {NONE, ON_START, ON_END}
>
> private DragEventType dragEventType = none;
>
> protected DragEventType getEventType( return dragEventType; );
>
>
> protected void respond(AjaxRequestTarget target) {
> // extract eventType from target
> dragEventType = extractedEventType;
> }
>
> -----
>
> The client could do
> @Overwrite
> protected void respond(AjaxRequestTarget target) {
> super(target);
>
> switch (getEventType()) {
> case ON_START....
> case ONENDSTART....
> }
> }
>
> 3. Or we could do something like
>
> protected void onStart(AjaxRequestTarget target){}
>
> protected void onEnd(AjaxRequestTarget target){}
>
> protected void respond(AjaxRequestTarget target) {
> // extract eventType from target
> if (eventType == onStart)
> onStart();
> else fi (eventType == onEnd)
> onEnd();
> }
>
> -----
>
> The client could do
> @Overwrite
> protected void onEnd(AjaxRequestTarget target) {
> // do onEnd processing
> }
>
> 4. In both cases we need something like
>
> public void setOnStart(boolean createOnStartListender)
> ...
>
> public void setOnEnd(boolean createOnEndListender) ...
>
> 5. We also could implement the onHover event of the DraggableTarget to
> complete the drag and drop events.
>
> Please let me know which was you want to go.
>
> Keep on Wicket!
>
> Stefan Lindner
>
>