[Seaside] What to write in the "onDrop:" ?
Richard.Durr at gmail.com
Richard.Durr at gmail.com
Thu Aug 13 13:44:33 UTC 2009
Hey Sebastian,
in my Bachelor Thesis, I do something like that this way:
html div id: myID;
onMouseOver: (html draggable
onEnd: (html request
callback: [:value |
self updatePositionOf: aPassenger with: value.]
value:
(html element id: myID) positionedOffset));
where value is a String in the form (x,y).
Am 13.08.2009 um 15:20 schrieb Sebastian Nozzi:
> Hello Seasiders,
>
> I am having trouble understanding how to make the Javascript
> (Scriptaculous) part talk to the Smalltalk one. Using Seaside 2.8.
>
> What I want to have are mouse-movable DIVs (which represend model
> objects) that remember their position the next time they are rendered.
>
> For that, I would like to know how to pass the coordinates (offset)
> from a dropped DIV back to the Smalltalk side and store that property
> in one model object. I've seen that SUElement provides something like
> this, but I'm clueless as to what to write in the #onDrop: part of my
> droppable to make the connection.
>
> It should extract the information via... Javascript? DOM? and send it
> back as a ajax-request to the server/smalltalk side... I am correct?
>
> The modified snippets would look like these:
>
> "Render the drop-container"
> html div script: (html droppable accept: 'myDraggableClass';
> onDrop: "..." ); with:[ ...
>
> "Render the DIVs to be dragged inside container"
> myElements do:[:e | html div passenger: e;
> class: 'myDraggableClass';
> script:(html draggable);
> with:'dragMe'].
>
> ...].
>
> Any hints? Are there examples on the use of SUElement and co.?
>
> Thanks in advance!
>
> Sebastian.
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
More information about the seaside
mailing list