How to know the "parent" form of a tab panel

Hi all.

I have a form (frm_apliacion) with a tab_panel (tab_botones_dlg) with a form (nav_botones_editar)containing two buttons

frm_aplicacion (form)
--------|
--------tab_botones_dlg (tab_panel)
--------------------|
---------------------nav_botones_editar(form)
--------------------------------|
---------------------------------btn_eliminar & btn_cancelar (buttons)

¿How can I know the name of the first form (frm_aplicacion) from the method executed by button_elimar or button_cancelar?
If I try var frm = application.getMethodTriggerFormName(); I recover the name of the form containing the buttons (nav_botones_editar).

Best regards. Roberto.

Windows XP / Ubuntu 10.04
Postgresql
Servoy 4.1.7 (build 690)

in Servoy 5 you have controller.getFormContext() which gives you all that information.

Thank you mery much jcompagner.

But I must use Servoy v.4 in this project :( . Is there any way to do the same in this version?

Best regards. Roberto.

the full stack can only be get by a 3th party bean then

but if you just want to know the current (main) form it is in then you can ask globals.currentcontroller for its data.

Of course this only works if you really want to have the main form. (many times the main form is always the same one, solutions just switch tabs)

Thanks a lot jcompagner

but if you just want to know the current (main) form it is in then you can ask globals.currentcontroller for its data.

I will try with it.

May be is not the “best” solution but it works.

I’d created a global variable called current_form_name. I fill this variable with controller.getName() in the onShow method of each form, so I can know the name of any active form everytime I want.

Best regards. Roberto.