I’ve been trying to find a way to ask this question so I can get an answer. I’ll try again here.
I have a number of containers on the left. I drag one of the them to the right (copy). I need the dropped container to have all the properties the dragged container has.
I’ve tried using obj.sender.property but because the sender is only identified as a web control (not a web container) Xojo says the property doesn’t exist. After dragging the container, the property exists but it’s blank.
I’ve been working on drag and drop from web listbox to web listbox. This is my next attempt to make this work.
Drag and drop on the web is a special beast because you have to set it up ahead of time, the drag happens completely on the browser and the only thing you get at the end is the result of the drag.
Right. All properties on the WebDragItem that you receive are read-only and Sender should be a reference to the control that was dragged.
That said, an example project would be helpful just to make sure youre setting up the drag properly.
Greg . . . Send the sample project on the feedback site?
Either that or a link here in the forum. Im not sure we have a bug yet, so here may be better (and more people will look at it).
I see only one problem. In ContainerControl12.DropObject, line 4 should be:
labelContainer.Label1.Text = ContainerControl1(obj.Sender).label1.text
Doing that and removing:
Label1.text = obj.sender.controlID
Seems to do the trick for me.
It seems a bit to have to call out where the object came from but ok.
Thank you very much Greg. It’s working for me too now.
Sorry . . . One more question: What’s the practical limit on the number of containers in a web app?
Im not aware of one. Why do you ask?
I’m just making sure I don’t run into trouble. This will require a lot of containers. Fifty, easily.
I doubt 50 will be a problem.
Ok . . . another question. When I add event handlers like mouse up and double click it disables drag and drop. Is there any way around this?
Not at this time. Those functions intercept the events needed for drag and drop.
Thanks. I figured that would be the case so I split my container in two and part of it clickable and part of it draggable. Lots more containers
Apparently 200 containers is a problem. The window shows but is not useable for over two minutes.
Any way to speed this up?