Synchronise foundset between forms - again

Servoy Developer
Version 3.5.10-build 524
Java version 1.5.0_19-137 (Mac OS X)

Hi all,

I have two forms based on same table and using same foundset: ‘tableA_form’ & ‘tableA_list’

At some point a user will be on a form from a different table: ‘tableB_form’ which will be a child record of tableA
On the tableB_form is a button which takes the user back to the parent record using a child-parent relation:

forms.tableA_form.controller.showRecords(tableB_to_tableA);

This effectively separates the foundsets between ‘tableA_form’ & ‘tableA_list’

What is my best way to synchronise the foundset between these two forms again ?

Cheers
Harry

I think what should do is

forms.tableA_form.controller.loadRecords(foundset)

while this is called from tableA_list

Hi Harry,

If memory serves me right then a controller.loadAllRecords() will relink the (shared) foundsets.
When unlinked then you need to do all the syncing yourself (in your code).

Hope this helps.

patrick:
I think what should do is

forms.tableA_form.controller.loadRecords(foundset)

while this is called from tableA_list

This does indeed load the foundset into the other form but doesn’t relink them. So even selecting another record won’t show through into the other form.

Thanks for the input guys,

So, given that I do not want to load all records in that particular table in the short term whilst the user is managing records, would I be better off changing my code from being a show records via the relation from tableB to performing a find in tableA based on the parent pk ?
This then may cut out the foundset management between the different views on any table never mind tableA

Cheers
Harry

Hi Harry,

If you don’t want to manage the 2 foundsets yourself then I think searching will be the best way.

ROCLASI:

patrick:
I think what should do is

forms.tableA_form.controller.loadRecords(foundset)

while this is called from tableA_list

This does indeed load the foundset into the other form but doesn’t relink them. So even selecting another record won’t show through into the other form.

this should work fine.

that way tableA will have the same foundset of tableA_list and when you change selection in one or the other both will follow.

But another way to avoid this completely
is to not use the same form as a main form and a tab or child panel.

When you do

forms.tableA_form.controller.showRecords(tableB_to_tableA);

make another instance of that tableA_form and let that show the relation.

I think that here, because of the circumstances and the way that the user needs to work between form and list views, I will use a find/search to isolate the record and maintain the foundset link between forms.

The user workflow is well established and it will be less overhead in keeping the forms in sync

Thanks you all for the replies

Cheers
Harry

We are having exactly the same issue. We use the loadRecords() and then a custom query to load a foundet. We have other forms that we would like to share that custom foundset rather than running the query again for each additional form and then manually keeping track of what row is selected between the various forms, etc. Will there be a way in future releases to link forms with separate foundsets to the same foundset?

The reason we are having this issue is we have table forms and then separate solution model forms below the table holding a table count (aggregate) field. So far this method has worked as expected with the related and standard foundsets, but does not work with tables using loadRecords().

if you want to have a form linked to the same foundset
then when you do stuff with 1 of the forms. you have to set it also on the other .

If 1 form is on a tab of the other… And you just want to have those 2 (parent<->child) always the same foundset.
we have support for that. make a Self relation
Thats a relation with the same datasource (server/table) on both size and no keys.

Then place the tab on the parent form with that relation. And then those 2 forms will always be in sync.