[Seaside] Scriptaculous, Drag & Drop problem

Marco Leberfing marco at leberfing.de
Sat Mar 22 17:07:23 UTC 2008


Hi,

I have a problem with drag&drop. The following example is based on the 
SUDragDropTest.
There are several list items on which i can drop and from which i can 
drag the objects.
Everything goes fine for some drag and drops, but after the second or 
third time the object
disappears. I think there?s a problem with the thml updater.
Are there some more examples about drag&drop or does some documentation 
about it exists?

renderPlaceholdersOn: html

1 to: self numberOfPlaceholders do: [: index|
    html unorderedList
        with: [html listItem
            class: 'placeholder';
                with: [self
                    renderPlaceholder: ('ph' , index printString) asSymbol
                    on: html]]]

renderPlaceholder: aSelector on: html

html div
    id: 'placeholder' , aSelector asString last asString;
    class: 'placeholder';
    style: 'width: ' , (self getPlaceholderWidth: aSelector) printString 
, 'px';
    script: (html droppable
        accept: #('visual');
        hoverclass: 'hover';
        onDrop: (html updater
            id: (self getPlaceholderId: aSelector);
            triggerPassenger: [:value | (self perform: aSelector) add: 
value.];
            callback: [ :renderer | self renderPlaceholder: aSelector 
on: renderer]));
        with: [self renderPlaceholderItemsFrom: aSelector on: html]

renderPlaceholderItemsFrom: aSelector on: html

(self getPlaceholder: aSelector) do: [ :each |
    html div
        class: 'visual';
        passenger: each;
        script: (html draggable
            revert: true;
            onDropped: (html updater
            id: (self getPlaceholderId: aSelector);
            triggerPassenger: [:value | self onDropped: aSelector]));
        with: [each asVisualObjectOn: html in: self]]

any ideas what I?m doing wrong?
Marco



More information about the seaside mailing list