This is a general Ajax problem. The ajax calls fired by the jQuery handlers 
dragStart/drag/dragEnd are not sychronized with each other. So it may happen 
that the onDrop event of the droppable is fired BEFORE the dragEnd.
In the onDrop method you replace the dragged component wit a new one (redrawing 
your repeaters).
Then, afterwards, the dragStop event occurs and your component no longer exists.
If you really need to watch teh dragStop in addition to the onDrop, you need to 
synchronize your actions. This means you have to wait for the onDrop response 
BEFORE you redraw you components or in othe rwords: move the onDrop code to the 
onDragEnd.

Sorry, but this is a general problem that can't be fixed in jWicket.

Stefan

-----Urspr√ľngliche Nachricht-----
Von: DerBernd [mailto:beha...@web.de] 
Gesendet: Freitag, 4. Juni 2010 11:36
An: users@wicket.apache.org
Betreff: RE: drag and drop


So here is my Example Case
I have several "Platzhalter" which implement IDroppable and some
"FeldKurs"Objects which implement IDraggable. The FeldKurs Components are 
dragged on Placeholders.

When I define
dragger.setWantOnDragStartNotification(true);
dragger.setWantOnDragStopNotification(true);
there occurs an error like:
"WicketMessage: org.apache.wicket.WicketRuntimeException: component
panelInhalt:listPanel:panelWochenplanung:platzhalter_t0r0:listPanel:feldKurs101
not found on page kursa.wochenplanung.WochenplanungPage[id = 3], listener
interface = [RequestListenerInterface name=IBehaviorListener, method=public
abstract void org.apache.wicket.behavior.IBehaviorListener.onRequest()]"


When I set them false or don't even set anything (default) the error doesn't
occur

Heres the code

public class Platzhalter extends Panel implements IDroppable{

...
private final RepeatingView listPanel;

public void onDrop(AjaxRequestTarget target, Component draggedComponent,
                        SpecialKeys specialKeys) {
                this.listPanel.add(draggedComponent);
                WochenplanungPage wochenplanungPage = 
findParent(WochenplanungPage.class);
                          // Parent Page of Platzhalter
                target.addComponent(wochenplanungPage);
        }
}


public class FeldKurs extends Panel implements IDraggable{
...

public FeldKurs(String id, Kurs kurs) {
                super(id);
                this.kurs = kurs;
                dragger = new DraggableBehavior();
                dragger.setRevert(DraggableBehavior.DragRevertMode.INVALID);
                dragger.setDistance(20);
                dragger.setOpacity(0.99);
                          dragger.setName("one");
                dragger.setWantOnDragStartNotification(true);
                dragger.setWantOnDragStopNotification(true);
                dragger.setCursor(CssCursor.MOVE);
                add(dragger);

}
...
}




-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/drag-and-drop-tp1881857p2242938.html
Sent from the Wicket - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to