|
<< Click to Display Table of Contents >> Manual > Screen Creation Guide > Forms and Dialogs/Frames/Views > About form and view names |
A form must be named. Also, a form cannot be operated from a script unless it is open. To open a form, use the route method "OpenForm". Immediately after calling OpenForm, you will be able to reference the form from a script, as shown below.
::OpenForm("Form01"); ::Form01.FillColor = "#00FF00"; |
In Ver6 and later, it is now possible to manage forms with the same name in separate folders. When opening a form by specifying a folder name, separate the folder name and form name with a "." (period) as shown below.
::OpenForm("Folder01.Form01"); |
Furthermore, if you open a form by specifying a folder name as in the example above, when referencing an object of that form from a script, you must replace the "." (period) specified as the separator between the folder name and the form name with an "_" (underscore).
::OpenForm("Folder01.Form01"); ::Folder01_Form01.FillColor = "#00FF00"; |
|
When specifying a form using the OpenForm method etc., if the form name is unique, it is not necessary to include the folder in the specification. (If you open a form by specifying a folder name, care must be taken as in the above example when accessing it from a script, so if you do not need to specify a folder, specify only the form name.) |
|
You can also access the form object using the GetForm root method, see GetForm root method for more information.
var vObj = ::GetForm("Folder01.Form01");
::OpenMsg(vObj.Comment);
|
The view name is the name used to specify which view (display area) to display when the form is opened in a View control or frame.
Also, when you open a form as a dialog, the view name is used as the name to identify the displayed dialog.
View Type |
Commentary |
Main View |
The main view refers to the default form display area, and has a fixed name defined as "MainView". If you do not use a frame, the form displayed by the root "OpenForm" method will be displayed in the main view. If you use a frame (if the frame settings are defined in the root property "DefaultFrame"), the frame specified in the Main parameter of FRAMESET will be the main view. |
In-frame view |
When you define frames using the root property "DefaultFrame", you define the individual view names for each frame using the Name parameter of FRAME. Note that the frame specified as the main using the Main parameter of FRAMESET will be the main view. |
View control |
The name specified in the "ViewName" property of View control will be the view name.
|
dialog |
The name specified as the viewName dialog parameter of "OpenDialog" will be the view name. The view name specified here will be used as the name specified when closing the dialog with the "CloseDialog" method.
|
Once you set these view names, you can specify them in the ViewName argument of the following route methods:
OpenViewForm / OpenHomeForm / ClearFormHistory / OpenPrevForm / OpenNextForm / IsHaveNextForm / IsHavePrevForm / GetCurrentForm /ResetZoom / SetZoom / GetZoom / SetStretch
In addition to the methods mentioned above, in the
dialog, you can also specify the viewName argument of the following route method.
ShowDialog / BringDialogToTop / SetModalDialog / CloseDialog
View Type |
Commentary |
||
Main View
|
The form specified by the root property "DefaultForm" will be displayed initially. The form specified by the root "OpenForm" method will open. |
||
In-frame view
|
The form specified by the BaseFormName of each FRAME in the frame setting of the root property "DefaultFrame" will be initially displayed. For the frame specified by the Main parameter of FRAMESET, the form specified by the root property "DefualtForm" will be initially displayed as the main view. You can specify the view name and form name to open using the root "OpenViewForm" method. |
||
View control
|
Initially displays the form specified by the BasedFormName/FormName property of View control. Opens the form specified by the root "OpenViewForm" method or the View control "OpenForm" method. |
||
dialog
|
Displays the form specified in the first argument of "OpenDialog" in a dialog.
To open a form as a dialog, use the common method "OpenDialog". The absolute path can be used immediately after calling OpenDialog as shown below.
When opening multiple dialogs based on the same form, the absolute paths will be duplicated, so you can specify different names for the form name (formName parameter) and view name (viewName parameter).
Furthermore, you can also specify the form including the folder name when passing the original form name to the first argument of the OpenDialog method (folder name.form name).
|