New record not updating over network

When a form that is set to Table view with two columns is placed on a tabless TabPanel, new records that are added to the table are not updating over the network. The only way I can get the new record to update is by clicking the header of the Table to sort.

On a TabPanel that does have tabs new records update fine (when I switch to a different tab). So the problem appears to be specific to tabless TabPanels. More testing indicates that the same thing happens when the form is set to List view instead of Table view.

I am running RC11 on Windows XP Professional.

this is the right behaviour
only relation foundsets will update them self when you have made a new record somewhere.

Normal foundsets (browseall or own search) don’t do that for that. A new browse all, sort or search command will reveal the new records..

I am still not able to get this to work. I would like to have a “Refresh Data” button at the top of a Contacts file form that has the above described tabless TabPanel.

Could you give me an example of a method for the “Refresh Data” button that will force the table within the tabless TabPanel to update, such that a new record added to the TabPanel items by one client will be visable to another client that clicks the “Refresh Data” button?

A new browse all, sort or search command will reveal the new records..

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. LoadAllRecords() comes the closest, but it loads all records from the related file instead of just the related records. I am probably missing something that should be obvious. I just can’t seem to jolt the TabPanel into updating to show all the latest related records. Any suggestions would be greatly appreciated.

sorry i thought you where talking about not related tabpanel.. (read wrong)

But you are saying that you see the difference betweek tabless and tabbed panels?? That is just impossible. That is just a gui thing have nothing to do with data. For example it works when you are making the tabless tabpanel a tabbed tabpanel??

and what do you mean by “when i switch to a different tab”? Do you need to switch first before you see the change???

I should update right in front of you..

Best thing would be to send over a small example with the description which one goed wrong when you do this…

Johan, I think what Westy means is, that if (s)he have multiple tabs and switch between them, than the new record is shown.

in a tabless panel, you simple, can’t switch from one tab to another, so the new record is not shown.

I think a button on the form (which is shown in a tab(less)-panel) with the following method:

controller.loadRecords()

will do the trick!

Yes, the following loadRecords() method solves the problem:

forms.items_tabpanel.controller.loadRecords();

With “items_tabpanel” being the name of the form behind the tabless TabPanel. By including the path to the form it appears that I am able to leave the “Refresh Data” button at the top of our Contacts form instead of on the TabPanel (and use the same approach to refresh all tabpanel forms with one click, by adding a similar line for each form). Seems like a nice way to refresh data with minimal network chatter. Johan and HJK thank you very much for helping me get over this little speed bump along the sunny Servoy road to a finished solution. :)

but that still doesn’t answer my question.

If you have Related data showing in a tabpanel (tabbles or not) then the data should be updated without any user interaction…

isn’t that the case?

Johan, that is true.

But not if another Client has exact the same form with the exact the same tabpanel in sight. Than the new record is not shown there!

And what if you do a controller.saveData() ?

Just tried it. No, did not work. Appears that only the controller.loadRecords() works.

ofcourse! :lol:

An enhancement is made in Servoy 2.0 rc12 for better support of new rows created by others, they will be visible in related foundsets and normal table foundsets where is not yet is searched in.

Very Nice!!!
:D Thankx

Wonderful. Very much appreciated! :D

Great thank you guys…

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.