Westy:
I’ve tried:
loadAllRecords()
sort()
find()
omitRecord()
showOmitted()
relookup()
deleteRecord()
newRecord()
updateUI()
visable(false)
visable(true)
and just about every possible combination of the above and I still cannot get a new record entered by another client to show up in a local client’s tabless TabPanel.
I had problems with this myself when showing a related tab panel. It seemed to me that when a new record met the existing search criteria, that Servoy should poll the db and update the interface for you.
My solution to the problem was to use the onRecordSelection event and run a method that would use
databaseManager.refreshRecordFromDatabase(foundset, recordIndex);
This means each time you moved to a new record the database would be queried again. I would call a method in the related tab panel as well that would do the same.
However, the problem with this approach is, anytime you run a loop across a foundset of records. EACH time you move to the next record, the app would hit the database two times - even if it wasn’t necessary within the loop. This is not good when you are doing something like sending out email to a large list.
I’m glad they are going to fix this because having to update the interface by hitting the database when records are changed or created, that fall within the current criteria, should be something that Servoy should handle - because they can do it more efficiently.
The lesson in this posting is the following. If you are going to use the onRecordSelection event AND use a loop that cycles through records in a found set, then it might be a good idea to make another form that doesn’t use the onRecordSelection and run your loop there. This will optimize your record loop and prevent unncessary overhead.
But the BEST solution of all, if you are going to cycle through a found set of records is to move the foundset into an array and cycle through the foundset in code, not by moving from record to record.
You have to learn how to use a progress bar and lock out the interface, but you avoid locking records and some actions will be MUCH faster doing things in code versus moving from one record to the next.