When I do this: forms.customer.controller.ShowRecords(relation_to_relation)
I’ll get a related foundset. The shared foundset between forms is now broken.
From there we have to take the foundset with us, with loadRecords otherwise we loose the foundset.
Can we have function, which converts such a foundset to a normal foundset?
(the one you have when you do a search)
You have to think about a foundset as an object, an object which is default used by multiple forms which are on the same table.
But when you load a form with another foundset object, than there is a difference beteen those forms on the same table, I have no idea how we could make this different.
Jan Blok:
You have to think about a foundset as an object, an object which is default used by multiple forms which are on the same table.
Sure Jan, but I think that we all - servoy developpers - have ran into this issue (very) often.
Jan Blok:
But when you load a form with another foundset object, than there is a difference beteen those forms on the same table, I have no idea how we could make this different.
And as you say it, we talk about objects.
Say we have two forms, A & B, sharing the same ‘main’ foundset F1.
Then, we disjoin foundset for form B making it point to F2.
What we all developpers will want is either:
have the ability to restore foundset of form B, pointing it again to object foundset F1
or better, have the ability to replace the ‘main’ or ‘shared’ foundset F1 by another foundset object at runtime
These two features together would resolve all ‘disjoined’ foundset issues in my opinion.
Well if you have 2 forms sharing the same foundset, and you have loaded an other (related) foundset in one of them, to restore just load the original foundset from one Form back into the other.
I use a form with a seperate foundset to use for searches.
After the search I load the foundset into a listform.
I also load that same foundset into another form (details).
You would think that these 2 forms are now using the same foundset object. But browsing through the list doesn’t change the selection in my detail form.
So they are not linked.
Here is my pseudo code:
var fs = forms.mySearchForm.controller.duplicateFoundSet();
forms.myListForm.controller.loadRecords(fs);
forms.myDetailForm.controller.loadRecords(fs);
How can I make forms use the same foundset object (and thus be linked)?
Servoy Developer
Version R2 2.1.2-build 315
Java version 1.4.2-38 (Mac OS X 10.3.8)
So this means it’s not possible to use one form as a search form for multiple foundsets in a solution.
At least not without losing the linked foundsets.
So I guess this is a feature request then.
I like to be able to create a foundset object (like a duplicate from another foundset). When loaded into a foundset of multiple forms these are linked by the same foundset object.
ROCLASI:
So this means it’s not possible to use one form as a search form for multiple foundsets in a solution.
NO!
There is a property on a form “useSeparateFoundSet” when used this means the Servoy makes sure there is always a separate foundset in that form, no matter what you load into that form.
In ALL other occasions (not using useSeparateFoundSet) It is up to you! YOU decide if forms share a foundset… by loading the same foundset in both forms.
ROCLASI:
So this means it’s not possible to use one form as a search form for multiple foundsets in a solution.
NO!
There is a property on a form “useSeparateFoundSet” when used this means the Servoy makes sure there is always a separate foundset in that form, no matter what you load into that form.
In ALL other occasions (not using useSeparateFoundSet) It is up to you! YOU decide if forms share a foundset… by loading the same foundset in both forms.
I know about the useSeparateFoundSet. My point is that I like to use one form as a ‘template’ for multiple foundsets.
I use the term ‘template’ loosely here.
Lets say I have 2 forms linked by the same foundset.
One is used to display a list and one for detail.
And I have 2 other forms with the same setup.
All pointing to the same table.
Now I like to use 1 single form to do searches. When there is a result the foundset should be transfered to the list and detail form where this searchform was called from.
But I want to do the same thing with the second set of forms. Without altering the foundset of the first one.
Assigning foundsets works fine, but the forms are no longer linked.
This is where my feature request comes in.
ROCLASI:
Assigning foundsets works fine, but the forms are no longer linked.
I don’t fully understand your question/senario, but if you assign the same foundset to different forms they ARE linked. (if of course separateFoundset not is used)
table A table A
+---------+ +---------+
| form A1 |-- linked foundset --| form A2 |
+---------+ +---------+
listview record view
And 2 other forms.
table A table A
+---------+ +---------+
| form B1 |-- linked foundset --| form B2 |
+---------+ +---------+
listview record view
Now I like to do searches on both sets of forms and have separate foundsets. But the 2 forms in each set should stay linked.
Also I do the search in a third form so I can reuse my code/form.