> It's not the code for finding the component that bothers me.  as you
> said, it's very easy.  My problem is that now you have to muck with
> the scriptaculous javascript callback to extract the component path
> instead of just using the default behavior which is to transfer the
> markup id.  This makes the code more brittle in my opinion since the
> scriptaculous behavior may change in the future.
I didn't change a single line of scriptaculous code.
You could verify by md5sum on each of the js files and compare to the
latest scriptaculous 1.8.1.

The changes that I did was on the generated javascript for both
[DraggableTargetBehavior] and [DraggableBehavior].
For draggable behavior, the generated html looks like:

[Snippets]
<img style="position: relative;" class="Picture"
wicketcomponentpath="0:dynamicContainer:replaceablePanel:favorite:dynamicContainer:content:pictureDataView:1:picture"
src="http://localhost:8080/war/pictures/100.jpg"; id="picture144"
height="50" width="50">
<script type="text/javascript">
new Draggable('picture144',
{
  revert: true
}
);
</script>
[/Snippets]

and the generated html for component with [DraggableTargetBehavior]:
[Snippets]
<img style="position: relative;"
src="http://localhost:8080/war/pictures/100.jpg";
id="playlistPictureField121" height="50" width="50">
<script type="text/javascript">
Droppables.add('playlistPictureField121',
{
  onDrop: function(draggable, droppable, event) {
var wicketComponentPath = draggable.getAttribute( 'wicketComponentPath' );
wicketAjaxGet('?wicket:interface=:0:dynamicContainer:replaceablePanel:playlistDetailPanel:playlistPictureField::IActivePageBehaviorListener:0:-1&amp;wicket:ignoreIfNotActive=true&wicketComponentPath='
+ wicketComponentPath); },
  accept: new Array('Picture')
}
);
</script>
[/Snippets]

As u can see, that wicketComponentPath is an attribute of the drag
source html node, and I use
[draggable.getAttribute( 'wicketComponentPath' )] to retrieve the
wicket component path of the drag source html node.

> Also, I still don't see how this would work for the SortableListView?
I need to see what u did here. Will get back to u in 1 hour or so.

Regards,
Edward Yakop

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

Reply via email to