The reason why this might not work is when we have the following use case:
* We have many draggable target, and when somebody drop to one of the
location, containers that contained the other draggable targets are
also added to ajax request target. Once this happened, none of the
other draggable targets will work.
* The same thing also applies to Droppables, if the container of
droppables are added to the AjaxRequestTarget. These droppables will
no longer work too.

The way that this is fixed at my project is by forcing the user to use
my ajax request target.
I have a hook to ajax request target to listen when components are
added to ajax request target, and do necessary callback to allow the
behaviors to do something. In my case, usually called
Droppables.remove( $( markupId ) ), and for Draggables, since there's
no easy way to potentially need to re-initialize some but not all, I
have to iterate the Draggables.drag array and inovoke
Draggable#destroy.

I would think there probably a better way to handle this without
subclassing AjaxRequestTarget. Will come back to this later.

Regards,
Edward Yakop


On Feb 14, 2008 12:53 AM, Ryan Sonnek <[EMAIL PROTECTED]> wrote:
> Ok everyone, I think I have a fix checked in.  Before re-rendering the
> DraggableTarget on the Ajax response, I call the scriptaculous
> Droppables.remove() to cleanup the old reference.
>
> The wicketstuff-scriptaculous-example project should be able to test
> and verify this behavior.  If anyone has a spare browser that they can
> throw at it to see that it works, I'd appreciate it.
>
> Thank you *everyone* for your contributions.  I never would have
> noticed this issue without your help!
>
> On Feb 13, 2008 10:39 AM, Nino Saturnino Martinez Vazquez Wael
> <[EMAIL PROTECTED]> wrote:
>
> > if you have an example running, i'll be happy to test on safari and
> > ie6/7/ff ..
> >
> >
> > Ryan Sonnek wrote:
> > > No, i haven't yet.  the problem for me is that I don't have an install
> > > of IE6/7 to test this out on.  I'd be happy to apply any patch that
> > > someone has that has been tested against IE6 and IE7 though.
> > >
> > > On Feb 13, 2008 12:54 AM, Edward Yakop <[EMAIL PROTECTED]> wrote:
> > >
> > >> Hi,
> > >>
> > >> Thanx for the hints :)
> > >> The problem is solved, but I'm not sure whether Ryan has patched the
> > >> scriptaculous code in wicket-stuff svn.
> > >>
> > >> Regards,
> > >> Edward Yakop
> > >>
> > >>
> > >> On Feb 13, 2008 2:10 PM, Ernesto Reinaldo Barreiro <[EMAIL PROTECTED]> 
> > >> wrote:
> > >>
> > >>> Don't know if it is the same issue but I have found  the same problem a
> > >>> while ago (refreshing a component via Ajax) and the problem was
> > >>> scriptaculous requires to clean up the Droppables  if an element was
> > >>> removed from the DOM tree. So, all I did was add a a clearAll
> > >>> (JavaScript) method  that delete all the Droppables. something like
> > >>>
> > >>> var Droppables = {
> > >>>   drops: [],
> > >>>
> > >>>   removeAll: function(element) {
> > >>>     this.drops = [];
> > >>>   },
> > >>>
> > >>> ......
> > >>>
> > >>> and then call it before any Ajax request that recreated the DOM tree. So
> > >>> that I could safely recreated my component and make them droppables
> > >>> again. This worked fine for IE7. For Firefox I never found those
> > >>> problems... There was a note on the web page explaining Droppables that
> > >>> suggested this idea...
> > >>>
> > >>> Hope this helps...
> > >>>
> > >>> Best,
> > >>>
> > >>> Ernesto
> > >>>
> > >>>
> > >>> Lan Boon Ping wrote:
> > >>>
> > >>>> Hi,
> > >>>>
> > >>>> I have encountered a DragNDrop problem using wicketStuff-scriptaculous
> > >>>> in IE6/IE7. The DragNDrop only work for the first time, but
> > >>>> subsequently, the draggable object is no longer draggable. FYI, this
> > >>>> problem doesn't exist in Firefox and it can be reproduced in
> > >>>> wicket-contrib-scriptaculous-examples.
> > >>>>
> > >>>> Any hints?
> > >>>>
> > >>>> Thanks in advance.
> > >>>>
> > >>>> Regards
> > >>>> Boon Ping.
> > >>>>
> > >>>> ---------------------------------------------------------------------
> > >>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >>>> For additional commands, e-mail: [EMAIL PROTECTED]
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>> ---------------------------------------------------------------------
> > >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >>> For additional commands, e-mail: [EMAIL PROTECTED]
> > >>>
> > >>>
> > >>>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >> For additional commands, e-mail: [EMAIL PROTECTED]
> > >>
> > >>
> > >>
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> > --
> > Nino Martinez Wael
> > Java Specialist @ Jayway DK
> > http://www.jayway.dk
> > +45 2936 7684
> >
> >
> > ---------------------------------------------------------------------
> >
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to