Relationship into a splitpane

Hi all.

¿How can I set a related form in a Splitpane?

forms.frm_init.splitpane.setLeftForm(forms.frm_custumers, null);
forms.frm_init.splitpane.setRightForms(forms.frm_orders, forms.frm_custumers.custumers_to_orders)

This doesn’t works … :(

Best regards. Roberto Blasco.

Hi Roberto,

Just use the relationshipname as a string like so:

forms.frm_init.splitpane.setRightForms(forms.frm_orders,"frm_custumers.custumers_to_orders")

Hope this helps.

Hi ROCLASI.

Tested

forms.frm_init.splitpane.setLeftForm(forms.frm_custumers, null);
forms.frm_init.splitpane.setRightForms(forms.frm_orders, "forms.frm_custumers.custumers_to_orders"):

and

forms.frm_init.splitpane.setLeftForm(forms.frm_custumers, null);
forms.frm_init.splitpane.setRightForms(forms.frm_orders, "frm_custumers.custumers_to_orders");

and

forms.frm_init.splitpane.setLeftForm(forms.frm_custumers, null);
forms.frm_init.splitpane.setRightForms(forms.frm_orders, "custumers_to_orders");

whith the same result. No relationed dataset showed in right form.

The way I’ve resolved it …

forms.frm_init.splitpane.setLeftForm(forms.frm_custumers, null);
forms.frm_orders.foundset.loadRecords(forms.frm_custumers.custumers_to_orders);
forms.frm_init.splitpane.setRightForms(forms.frm_orders, null);

and using onRecordSelection on the left panel to update the right panel.

Best regards. Roberto Blasco.

Are you sure your problem is not because of a typo?
Because the method name is setRighForm() and not setRightForms()

Thanks ptalbot.

Sorry I wrote the example on the fly, in my code is well written. This is the exact code

forms.lst_tab.elements.tab_lst_horizontal.setLeftForm(forms.lst_casos, null);
forms.lst_reg.foundset.loadRecords(forms.lst_casos.t100_casos_to_t100_registros);
forms.lst_tab.elements.tab_lst_horizontal.setRightForm(forms.lst_reg, null);

lst_casos has t100_casos datasource
lst_registros has t100_registros datasource
t100_casos_to_100_registros relatioship is well done and works
forms.lst_tab has no datasource.

I’ve built a little example with ROCLASI answer, but it doesn’t works.

Best regards. Roberto Blasco.

Servoy Version: 5.2.6 - build 1011
Oracle 10g Express
Windows XP SP2

test.servoy (7.59 KB)

On which table is the form based on which the splitpane is placed? In order to use “customer_to-orders” in the following code, the form that contains the splitpane needs to be based on the customers table:

forms.frm_init.splitpane.setRightForms(forms.frm_orders, "custumers_to_orders");

Paul

Hi pbakker.

The forms where the splitpane is placed has no datasource related.

As you say the solution works. :D. Thanks !!!

Is there any way to dinamic set the form datasource?
This is because I use this form to show data from many tables. Do I need to use one form containing the splitpane for each datasource?

Best regards. Roberto Blasco.

Using the solutionModel you could change the datasource at runtime. But I think the route you’ve taken now, to load the related foundset into the form is a lot cleaner (and less code), so I’d stick with that.

Paul

Thanks a lot pbakker.

I’ll do it like you say. :D

Best regards. Roberto blasco.