Hi,

Boon Ping and I managed to modify scriptaculous to get wicket component to
be passed during onDrop callback.
We changed the DraggableTargetContainer? to become a wicket behavior. 

We concluded by doing it this way, we can practically make any wicket
component (tested for label and img, so far) to be a drop target.

For example,
<Code for DraggableTarget>
final ContextImage image = ...
add( image );
DropHandler handler = new DropHandler() {
  public void onDrop( Component aDragSourceComponent, AjaxRequestTarget
aTarget )
  {
    String newImageURL = (String) aDragSourceComponent.getModelObject();
    image.setModelObject( newImageURL );
    aTarget.add( image );
  }
}
image.add( new DraggableTargetBehavior( handler, "Image" ) ); // Image is
the drag type
</Code for DraggableTarget>

<Code for Draggable source>
ContextImage source = ...
add( source );
source.add( new DraggableBehavior( "Image" ) ); // Image is the drag type
</Code for Draggable source>

On another note, we encounter weird problem when scriptaculous is used in
deployment mode.
We have to invoke
WebApplication#getResourceSettings().setStripJavascriptCommentsAndWhitespace(false)
to get javascript to work.

Regards,
Edward Yakop
-- 
View this message in context: 
http://www.nabble.com/Is-wicketstuff-scriptaculous-still-active--tp14660810p14727336.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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

Reply via email to