Tech Tip: Order of loading events between parent and child forms
PRODUCT: 4D | VERSION: 18 | PLATFORM: Mac & Win
Published On: November 2, 2020
When transitioning to using ORDA form data, it is important to know the order of events that take place first. Take the example below containing a parent form with a subform container of a child form.
The order of events are as follows:
1. Child form's listbox events
2. Child form's On Load event
3. Parent form's subform container events
4. Parent form's On Load events
Since the child form's listbox event occurs first, the subform container object should be initialized as new object right before the parent form is opened in the 2nd parameter of the DIALOG command such as:
C_LONGINT($win_l) C_OBJECT($form_o) $form_o:=New object $form_o.Subform:=New object $win_l:=Open form window("ParentForm") DIALOG("ParentForm";$form_o) CLOSE WINDOW($win_l) |
This initialization will ensure that the subform container object exists prior to initialization the child form's listbox which can be either in the child form or the parent form.