web container drag and drop with all properties

  1. last year

    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.

    Help !!!

  2. Greg O

    15 May 2019 Xojo Inc scout.galaxy.barn

    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.

    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.

    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 you’re setting up the drag properly.

  3. Greg . . . Send the sample project on the feedback site?

  4. Greg O

    15 May 2019 Xojo Inc scout.galaxy.barn

    Either that or a link here in the forum. I’m not sure we have a bug yet, so here may be better (and more people will look at it).

  5. Here ya go:

    Drag Container Test

  6. Greg O

    15 May 2019 Xojo Inc scout.galaxy.barn

    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.

  7. 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.

  8. Sorry . . . One more question: What's the practical limit on the number of containers in a web app?

  9. Greg O

    16 May 2019 Xojo Inc scout.galaxy.barn

    @John S Sorry . . . One more question: What's the practical limit on the number of containers in a web app?

    I’m not aware of one. Why do you ask?

  10. I'm just making sure I don't run into trouble. This will require a lot of containers. Fifty, easily.

  11. Greg O

    16 May 2019 Xojo Inc scout.galaxy.barn

    I doubt 50 will be a problem.

  12. Thanks

  13. 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?

  14. Greg O

    19 May 2019 Xojo Inc scout.galaxy.barn

    @John S 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.

  15. 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 :)

  16. 7 months ago

    Apparently 200 containers is a problem. The window shows but is not useable for over two minutes.

    Any way to speed this up?

or Sign Up to reply!