web container drag and drop with all properties

  1. 5 days ago

    John S

    May 14 Pre-Release Testers, Xojo Pro

    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

    May 15 Xojo Inc

    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. 4 days ago

    John S

    May 15 Pre-Release Testers, Xojo Pro

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

  4. Greg O

    May 15 Xojo Inc

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

    May 15 Pre-Release Testers, Xojo Pro

    Here ya go:

    Drag Container Test

  6. Greg O

    May 15 Xojo Inc

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

    May 15 Pre-Release Testers, Xojo Pro

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

    May 15 Pre-Release Testers, Xojo Pro

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

  9. Greg O

    May 16 Xojo Inc

    @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. 3 days ago

    John S

    May 16 Pre-Release Testers, Xojo Pro

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

  11. Greg O

    May 16 Xojo Inc

    I doubt 50 will be a problem.

  12. John S

    May 16 Pre-Release Testers, Xojo Pro

    Thanks

  13. yesterday

    John S

    yesterday Pre-Release Testers, Xojo Pro

    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. 17 hours ago

    Greg O

    17 hours ago Xojo Inc

    @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. 7 hours ago

    John S

    7 hours ago Pre-Release Testers, Xojo Pro

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

or Sign Up to reply!