Sending data between events?

I still am a little confused on how to handle such things in Xojo…

I have a DropObject event for a List Box. Images are dropped and metadata is displayed.
The original file name (of however many images are dropped) should then be changed; both locally and on a server.
BUT, this is only to happen once the user hits a button. I originally had the names changing as soon as they were dropped on the window, but they didn’t like that. Sometimes they needed to redo it for whatever reason, and then they are left with image names that aren’t accurate anymore.

So with my button event, I have everything I need being sent to the server through a MySQL call. But how do I get the names to change on the local machine at this time? How do I get a reference to the dropped files from the DropObject event?

Sounds like you need an array of FolderItems populated in the ListBox’s DropObject event. That way they will be available when you are ready to use them.

@Dale Arends I’m still unable to access that array from the button Action event…

Did you make the array global, in a Module or public at the window or app level? If you created it as a variable in a method it will only be available from within that method.

Ok so I tried assigning the names to the RowTag property inside of the DropObject event of the list table:

//Add metadata to Listbox
for i as Integer = 0 to lstBoxImages.ColumnCount - 1
…some code here

    //add items to rowtag
    lstBoxImages.RowTag(lstBoxImages.LastIndex) = modFileName + ".tiff"

and then in the Action event of my button I have:

  for i = 0 to lstBoxImages.ListCount -1
    //sending data to server
    data.Column() = lstBoxImages.cell(i, 1)
    mdb.InsertRecord("table_name", data)
    //recall row tags for file re-naming = lstBoxImages.RowTag(lstBoxImages.LastIndex)
    if mDB.Error then
      MsgBox("Error: " + mDB.ErrorMessage)
    end if

This only renames the last of the images in the group that was dropped…

//recall row tags for file re-naming = lstBoxImages.RowTag(i)

[quote=462909:@Tim Hare]//recall row tags for file re-naming = lstBoxImages.RowTag(lstBoxImages.LastIndex)[/quote]
Tim’s correct, Michael. In your line of code

//recall row tags for file re-naming = lstBoxImages.RowTag(lstBoxImages.LastIndex)
the term stBoxImages.LastIndex will always refer to the last row added, regardless of the ListIndex, which is the selected row, or the counter in the loop.