The 2 forms are loaded. By default, the top most record of the left side (i. e. elements.tabSelection.addTab(…)) is selected and the right side records are shown. So far so good.
But clicking any other record on the left side does not refresh the relationship to show the corresponding records on the right side. This is, I assume, because the the left tab is NOT based on the correct table (periods, in this example), but is dynamically loaded onto a generic main form with a dummy table.
Is there a way to refresh the relationship to get the corresponding records on the right side displayed?
It would reduce the numbers of (intermediate) forms a lot, if this would work.
Best regards, Robert
PS: Attached a screenshot to show the situation as described above looks like
If you add 2 related tabs on the form and the second tab’s relation is the first tab’s relation plus another relation 1 level deeper, the selection of the first tab synchronises with the second one.
For example, main form is based on no table.
It contains 2 tabs, one based on g_custid_to_orders, the second on g_custid_to_orders.orders_to_orderdetails
The first tableview tab shows all orders of customer g_custid.
When selecting an order in this list, the order details of that order are shown in the second tab.
This is very nice to hear, thank you! We will soon be on Servoy 5, currently still on Servoy 4, as the transition means still some work to do, before the switch can be done.
My example is with Servoy 4.1.5, Mac OS X 10.6.2 and Java 1.6.
The left tab with the periods like HS 2009, FS 2009, … is directly on the table periods (containing the periods). The right tab is on the table classes. There is one relation from periods to classes called periods_accommodating_classes (starting from forms.PplPeriods)
Now I would expect when selecting periods on the left side, the right side to show the classes to this period. This only works for the top most selection(which is done by Servoy by defautl when loading the tabs). Any further selection of a period shows still the classes to the top most period (in my example HS 2009), so it means this doesn’t work. Will it work in Servoy 5?
if you have a global relation for example mycurrentperiods_accommodating_classes (from a global var (id of the current period) to period id of the class ) you can put a related tabpanel everywhere, and you only need to update your global var
these are the basic servoy relation concepts.
in your scenario, your question must be what could be the link between my two different tabpanels?
you could find a link with for example a global mycurrentperiods that could be updated onselectedrecord in your period form and a gloabl relation
Thanks for the suggestions. What I tried to mention is that in the addTab() method everything is already defined. The first form (in my example forms.PplClasses) is the related form, the form on the m-side of the relation. And it “knows” on which table it is based.
The form of the relation (the last parameter of addTab()) also “knows” on which table it is based. The relation is also defined. The last parameter reads in my example: forms.PplPeriods.periods_accommodating_classes. This is always the 1-side of the relation.
So everything necessary is defined, but it does’t work in Servoy 4. But it’s not a problem for us and we are very happy when it works in Servoy 5.
Merci, Robert
erdione:
It could work in 4.1.5
In servoy 4 or 5 when you have a relation you must have a starting point for you relation leading to the related foundset that will be displayed.
for example if your dummy form is based on periods, it’s very easy to display a related form in a tabpanel with this piece of code
if you have a global relation for example mycurrentperiods_accommodating_classes (from a global var (id of the current period) to period id of the class ) you can put a related tabpanel everywhere, and you only need to update your global var
these are the basic servoy relation concepts.
in your scenario, your question must be what could be the link between my two different tabpanels?
you could find a link with for example a global mycurrentperiods that could be updated onselectedrecord in your period form and a gloabl relation
May be I am missing something, but this example shows a static situation, not the dynamic one I described. There is no addTab() command, or at least I didn’t find it.
In your example, the 2 forms orders and order_details should be loaded dynamically to their tabless panels tabs_80 and tabs_190 with elements.addTab().
The order_details should be loaded with something like: elements.tabs_190.addTab(forms.order_details, null, null, null, null, null, null, forms.orders.orders_to_order_details);
That is the situation I tried to describe which does not work.
Could you have a look again, please.
Regards, Robert
rgansevles:
Robert,
Attached is a small example that does what I mean.
When you change the selection in the left tab (orders) the right tab changes (ordere details)