[Seaside] Moving an element in the DOM

Lukas Renggli renggli at gmail.com
Tue Nov 4 21:19:37 UTC 2008

That's a limitation of the Scriptaculous Smalltalk-to-Javascript
conversion API. You might want to use #call:with: and directly provide
the right arguments, or add your own helper method either in Smalltalk
or in Javascript (when things get more complicated).


On Tue, Nov 4, 2008 at 9:35 PM, Ryan Simmons
<ryan.craig.simmons at gmail.com> wrote:
> I tried to move an element above its sibling using something like
> html anchor
>  onClick: (html evaluator
>     callback: [:s |
>          self moveElement.
>          s element id: 'moveElement'; previous; insertBefore:
> (SUElement new id: 'moveElement')]);
>  with: 'move up'.
> This results in the text "$('moveElement')" being inserted into the
> correct position in the DOM.
> I managed to get it to work the way I expected it to by changing the
> following on SUElement
> insert: anObject position: aString
>       "Inserts anObject before, after, at the top of, or at the
> bottom of element."
>       self call: 'insert' argument: (Dictionary new
>               at: aString put: ((anObject isKindOf: SUElement)
>                                                          ifTrue: [anObject]
> ifFalse:[self render: anObject]);
>               yourself)
> Is this the correct way to fix this or should I have gone about this
> another way?
> Ryan Simmons
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

Lukas Renggli

More information about the seaside mailing list