Auto Refresh/Reload (listbox)

What is the best way to auto reload/refresh the data in a listbox after saving or editing an item?

That should be automatic.

This is how its gonna be, when we click a cell in Container1 and then click the edit button, another tab (Container2) will be open for the edit button. after saving the edited data, it wont autorefresh or reload since it was on different container.

What is a Container ? Is it new in 2019r2 ?

BTW: you want to refresh ? Read:

http://documentation.xojo.com/api/deprecated/rectcontrol.html#rectcontrol-refresh

[quote=460958:@Emile Schwarz]What is a Container ? Is it new in 2019r2 ?

BTW: you want to refresh ? Read:

http://documentation.xojo.com/api/deprecated/rectcontrol.html#rectcontrol-refresh[/quote]
I meant container control. Sorry.

ContainerCOntrol does not have Cell nor Button nor…

But issuing the Refresh (as in the provided link) in the Edit Button (at the end of the code) will do the trick.

Note: there are two syntax for Refresh (API 2).

  1. Add a Method to your Container1, like UpdateCellValueAt and make it Public.
  2. In this Method ask for a Parameter, like row and column As Integer and value As String
  3. In this Method change the Value of CellValueAt(row)
  4. In Container2 call the Method from Container1, like ContainerXYZ.UpdateCellValueAt(row, ,column, “Test”)
  5. As soon as Container2 gives the control back to container1, the UI should update automatically

In case of emergency add a Listbox1.InvalidateCell(row, column) to the method in container1. :wink:

*1: Keep all controls in your containers “Private” if possible.