When a form has child forms inside, how do I determine which of the forms is currently the active one? application.getMethodTriggerFormName() has been deprecated in favour of JSEvent and most responses on the forum refer to this.
The JSEvent from a button to move the record select is in the nav bar, so the event just has the name of the nav bar form; I keep the current parent form in a separate global variable, so I can access that but I cannot figure out how to determine which of the tab panels in the form is currently active. I feel there must be a simple way of getting the form that has focus with a current record selection.
The controller has a function getFormContext() that gives you a dataset with the complete hierarchy of the nested forms, including the tabpanel names and tab indexes (0 and 1 based).
var _dsContext = controller.getFormContext();
// for a quick output of the dataset. The top most form is the first record.
application.output(_dsContext.getAsText(",", "\n", "", true));
provides the window and the forms, all the way down to the parent form but not the tabs within it.
I’ve decided to go down the route of specifying any sub-forms to determine which is affected by the record navigation, as opposed to determining a generic rule.
provides the name of the navigation form (using svyNavigation), unfortunately.
Right, if every form is nested inside a navigation form my code will not work. I use my own navigation with one base form for each data type (client, invoice, project, etc)
I found with the Smart Client that putting the whole app inside one form led to bad performance because Servoy loaded too much stuff into memory.
The NG-Client may be a lot smarter so this is no longer an issue.