4D v13.4

Creating a multi-page form

Home

 
4D v13.4
Creating a multi-page form

Creating a multi-page form  


 

 

You can create multiple pages for an input form. If you have more fields or variables than will fit on one screen, you may want to create additional pages to display them. Multiple pages allow you to do the following:

  • Place the most important information on the first page and less important information on other pages.
  • Organize each topic on its own page.
  • Reduce or eliminate scrolling during data entry.
  • Provide space around the form elements for an attractive screen design.

Multiple pages are a convenience used for input forms only. They are not for printed output. When a multi-page form is printed, only the first page is printed.

There are no restrictions on the number of pages a form can have. The same field can appear any number of times in a form and on as many pages as you want. However, the more pages you have in a form, the longer it will take to display it.

A multi-page form has both a background page and several display pages. In the Form editor, objects that are placed on the background page may be visible on all display pages, but can be selected and edited only on the background page. In multi-page forms, you should put your button palette on the background page.

You also need to include one or more objects on the background page that provide page navigation tools for the user. For information on adding page navigation tools, see the Adding page navigation controls section.

Note: The Options page of the Form Wizard contains an option that instructs the Form Wizard to create a multi-page form automatically if the fields you select don’t fit on one page. If you selected this option, your form may initially have more than one display page. When the Form Wizard creates more than one display page, it puts buttons, variables, the form title, and decorative rectangles on the background page 0.

Every form has at least one display page and a background page. The current page number appears in the toolbar of the form window. This area also includes a pop-up menu that allows you to select the displayed page.

To add a display page:

  1. Choose Add Page from the Form menu. 4D creates a new page.
    OR
    Move to the last page of the form, then click the Next Page icon in the toolbar. 4D displays a dialog box asking if you want to add a page. Click OK to create the new page.
    A new, blank display page appears in the Form editor window. The page number area of the window displays the number of the page you are viewing. You can now add fields and other form elements to the new page.

To insert a display page before the current page:

  1. Choose Insert Page from the Form menu. 4D inserts a new page before the current page and displays it on screen.

When you want to display the background page or move to another display page, you can either use the page navigation tools in the Tools palette or the page pop-up menu in the Form editor window. 

To display the background page (page 0):

  1. Move to the first page of the form and click the Previous Page icon in the toolbar.
    OR
    Use the Page pop-up menu to move to page 0.
    OR
    Select 0 from the Goto Page> submenu in the Form menu.
    OR
    Press Alt+click (Windows) or Option+click (Mac OS) on an object belonging to page 0, or specifically outside any object belonging to the current page (the Alt+click or Option+click shortcuts on an object of the current page creates or opens the object method).
    4D displays the background page. The page number of the background page is zero (0). Objects located on the background page are displayed on each page. You can place any object type on the background page.

Note: There should be no confusion between using the Page 0 menu item from the Display submenu and actually making the background page the currently displayed page. Selecting the Page 0 menu item from the Display submenu only displays or hides the items of the background page in the current page. For more information, refer to “Showing/Hiding Elements in the Form Editor” in Form editor.

To use the page navigation tools:

  1. To move to the next page, click the Next Page icon in the toolbar.
    4D displays the page immediately following or prior to the current page.

If you click Previous Page while viewing the first page of the form, the background page appears. If you click Previous Page while viewing the background page, nothing happens. If you click Next Page while viewing the last page of the form, 4D asks if you want to create another page for the form.

To display any page:

  1. Click on the page number area and hold down the mouse button to display the associated pop-up menu.
    OR
    Display the Goto Page> submenu of the Form menu.
  2. Choose the desired page number.

You can delete unwanted display pages from a multi-page form. Any fields or other objects on the deleted pages will be deleted as well. The remaining pages are renumbered. You cannot delete the first page or the background page in a form that consists only of these two pages. 

To delete a page from the form:

  1. Use either the page navigation tools or the page pop-up menu to display the page you want to delete.
  2. Choose Delete Page from the Form menu.
    A dialog box appears verifying that you want to delete the page from the form.
  3. Click OK.
    The page and any objects on the page are removed from the form.

When you create a multi-page form, you need to provide a way for users to move from one page to another. 4D provides three ways that you can use to add navigation tools:

  • Tab control: The tab control object gives users random access to individual pages. You place the tab control on the background page of the form and use its properties to provide page navigation controls.
  • Automatic buttons: You can add automatic page navigation buttons to the form —First Page, Last Page, Previous Page, and Next Page. These buttons should be placed on the background pages.
  • Object methods: In addition, the language includes the FORM GOTO PAGE command. You can use this command as part of an object method to create custom navigation controls using any suitable object type. For example, you can choose to use a picture button or pop-up menu to provide page navigation controls.

Adding page navigation buttons
You can include page navigation buttons when you generate the form using the Buttons page of the Form Wizard. After the form is generated, open it in the Form editor and add the necessary pages. If you need to add the page navigation buttons after the form is created, you can do so using the button creation tool in the object bar. For more information, see Buttons.

Using a tab control
The tab control provides a visual indication of the current page and the remaining pages. For information on creating and activating a tab control, see Tab Controls.

 
PROPERTIES 

Product: 4D
Theme: Building forms