Draggable problems

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Draggable problems

Sophie424
I need to assign my own ID to a draggable. However, as soon as I add the
#passenger: it seems my ID is overridden by a framework-generated one. Any
ideas?

Sophie



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Draggable problems

Lukas Renggli
> I need to assign my own ID to a draggable. However, as soon as I add the
> #passenger: it seems my ID is overridden by a framework-generated one. Any
> ideas?

Seaside needs to uniquely identify the DOM elements during drag&drop
operations. You have two possibilities:

1. Wrap your DOM element with your own ID into one where Seaside is
able to choose its own ID.

2. Avoid using an ID (in my opinion this is not a good practice
anyway). Use a class instead.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Draggable problems

Sophie424
"Lukas Renggli" <[hidden email]> wrote in message
>> I need to assign my own ID to a draggable. However, as soon as I add the
>> #passenger: it seems my ID is overridden by a framework-generated one.
>> Any
>> ideas?
>
> Seaside needs to uniquely identify the DOM elements during drag&drop
> operations.

Yes, but I have my own unique IDs where I need them, and I do the
    id: myId
before I do
    passenger: ...

Would it make sense in this case for #passenger to check pre-existing #id,
and call a new method like:

WARenderingContext>>storePassenger:atId:
storePassenger: anObject at: anId
    (callbacks includesKey: anId) ifTrue: [self error].
    callbacks at: anId put: anObject
    ^ anId

> 1. Wrap your DOM element with your own ID into one where Seaside is
> able to choose its own ID.

It seems that might work, though I usually prefer not to do too much such
wrapping.

> 2. Avoid using an ID (in my opinion this is not a good practice
> anyway). Use a class instead.

I would if this was for CSS styling, but it is for direct Ajax editing of
specific elements among multiple similar css-classed ones.

Many thanks - Sophie



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Draggable problems

Lukas Renggli
> Would it make sense in this case for #passenger to check pre-existing #id,
> and call a new method like:
>
> WARenderingContext>>storePassenger:atId:
> storePassenger: anObject at: anId
>     (callbacks includesKey: anId) ifTrue: [self error].
>     callbacks at: anId put: anObject
>     ^ anId

No, script.aculo.us needs to have the drag & drop IDs to have a
special form. It is not possible to use your own ID.

> > 1. Wrap your DOM element with your own ID into one where Seaside is
> > able to choose its own ID.
>
> It seems that might work, though I usually prefer not to do too much such
> wrapping.

Me too.

> > 2. Avoid using an ID (in my opinion this is not a good practice
> > anyway). Use a class instead.
>
> I would if this was for CSS styling, but it is for direct Ajax editing of
> specific elements among multiple similar css-classed ones.

Assign the passenger first and then use this ID to enable Ajax editing.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside