Hi ,
I have a form visible with a filter applied to that form.foundset via foundset.loadRecords(_sql, _params)
Another Servoy user adds a record that should be in my filter. That new record is not automatically shown in my form. (only deletes and updates are broadcasted to the forms in use)
Does anybody knows a Servoy-command to refresh / requery / update UI my form without issuing the loadRecords again ? My table and foundset filters added through add…FilterParam() are repeated again and again if I read the foundset SQL and do the loadRecords again with that SQL.
Regards,
Can someone comment on this ?
Regards ,
Hi,
Have you tried databaseManager.refreshRecordFromDatabase()?
only related foundset will update them self with new inserts.
For you situation we had to do new queries constantly for all those foundsets if there is 1 insert.
jcompagner:
only related foundset will update them self with new inserts.
For you situation we had to do new queries constantly for all those foundsets if there is 1 insert.
Hi Johan,
I understand this is not easy doable / performance penalty server side.
That’s why I was looking for a nice and easy foundset refresh with respect to current foundset SQL possibility within Servoy client…
It’s something like in between loadRecords() and loadAllRecords()
Is in your opinion this refresh possibility a valuable extension of Servoy ?
PS We are now playing with the onDataBroadCast-event for new records to simulate (semi) automatic refreshing of foundsets…
Regards,
we could do something with a new method like reload() on foundset or some special loadRecords() call (with a boolean or something but this is maybe not so nice)
There is an other option, just call foundset.sort() with the same sort string you already have… so foundset.sort(foundset.getCurrentSort())
jcompagner:
we could do something with a new method like reload() on foundset or some special loadRecords() call (with a boolean or something but this is maybe not so nice)
There is an other option, just call foundset.sort() with the same sort string you already have… so foundset.sort(foundset.getCurrentSort())
Hi Johan,
Thanks for the tip of the foundset.sort() ! Works ok and does not touch the foundset-SQL-query.
The extension you mentioned would be welcomed. It would be nice to have a parameter to specify if you want to preserve the current record position (pk value) if possible.
Regards,
Hi Lambert,
I have the same problem in a new solution.
How did you implement this ```
foundset.sort(foundset.getCurrentSort())
Does the user push a button to refresh the foundset or did yoy create some kind of automatic refresh ??
Regards,
Hi Hans,
Yes, we added a refresh button to our framework. We thought about automatic refresh and what we did is the following :
When no user filter is active : refresh button is default disabled and becomes enabled when receiving a new record data broadcast for the current table.
When a user filter is active : refresh button is always enabled.
Besides of above we have an optional system setting to always have the refresh button enabled.
Regards,