Creating and Managing Forms
You create and manage forms
using the Project Explorer.
By default, when you create your Maintain procedure, WebFOCUS
Maintain creates an initial form, named Form1, with the necessary
code in the Top function to launch the form. You can rename this
form. The new name is automatically reflected in the Winform Show statement.
Note:
- If you delete
or rename a form, be sure to fix or comment out the Winform Show
command in the Maintain procedure that calls it. If you skip this
step, Project Explorer shows a marker in place of a deleted form.
If you click on that marker, a message appears stating that the
form does not exist and asking if you want to create it.
- After you delete
the Winform Show command from a form, be sure to remove it or comment
it out. If you skip this step, Project Explorer will show a marker
in place of a deleted form. If you click on that marker, a message
appears stating that the form does not exist and asking if you want
to create it.
x
Procedure: How to Create a Form
-
Select
the Maintain procedure that you want the form to be part of.
Note: You must deploy all forms in an application
to the same WebFOCUS Server. Keep this in mind when deciding which
procedure to place your forms in.
-
Right-click
the procedure, click New in the shortcut
menu, and click Form in the submenu.
The
new form opens in the Form Editor.
After you have created
a form, it is displayed under its procedure in the Project Explorer.
x
Procedure: How to Edit a Form
-
In the
Project Explorer, open the procedure that contains the form you
want to edit.
-
Open
the Forms folder.
-
Right-click
the form, and in the shortcut menu, click Open.
or
Double-click the form.
The
form opens in the Form Editor.
x
Procedure: How to Rename a Form
-
In the
Project Explorer, right-click the form, and in the shortcut menu,
click Rename.
or
Select the form and press F2.
or
Select
the form, then click it again to edit its name.
-
Type
your new name.
-
Press Enter to
confirm your change.
xExporting and Importing Forms
Sometimes you might want to base forms from different
procedures on a single template. The Maintain Development Environment
enables you to export a form to a file, and then import it into
another procedure.
Keep in mind that when you import a form into a different procedure
from the procedure you exported it from, WebFOCUS Maintain preserves
bindings to resources such as web links, scripts, and graphics,
but not to variables or data source stacks (since variables and data
source stacks are defined only in the context of a procedure).
x
Procedure: How to Export a Form
-
In the
Project Editor, right-click the form and click Export.
-
In the
Export As dialog box, enter a name for your form and click Save.
WebFOCUS
Maintain saves your form in a file with the extension .for in the project
folder.
x
Procedure: How to Import a Form
-
In the
Project Editor, right-click the Maintain procedure you want to import
the form into and click Import forms.
-
In the
Import Form dialog box, select the form you want to import and click Open.
If you cannot see the form you want to import, make sure
that it is in one of your project paths.