Exercise 2: Creating custom Edit and Query forms

Exercise 1: Creating a default configuration file for toolbars (pole inspection)Exercise 3: Deploying customized AXF files

Creating a custom data entry form with data validation for an AXF layer

Next, you will create a layer definition file for the Poles layer. Layer definition files provide a way of delivering customizations loaded with the data in ArcPad.

This exercise introduces the basic techniques for creating custom forms to perform initialization and data validation for ArcPad Exchange Files (AXF). You will see that there is very little work done in ArcPad Studio and that data validation is initiated in the geodatabase. For this exercise, you need to create an AXF file in ArcMap.

Creating an AXF file using ArcPad Data Manager in ArcMap

You will start by checking out data from a geodatabase. For full guidance on how to check out data, refer to the ArcPad Help. The following demonstrates the minimum steps:

Steps:
  1. Start ArcMap and open C:\Documents and Settings\All Users\Documents\ArcPad\Samples\Riverside\Riverside.mxd (on computers running Windows Vista or Windows 7, the sample data is installed under Public Documents). See the following screen shot: Screen shot showing ArcPad Data Manager toolbar in ArcMap.
  2. Click the Get Data For ArcPad button on the ArcPad Data Manager toolbar. The Get Data For ArcPad - Select Data dialog box appears.
  3. Click the arrow under the Action column for the Poles layer. Several action options appear. Select Check Out for disconnected editing in ArcPad, then Data based on defined extent. See the following screen shot:
    Screen shot showing action options.
  4. Select Export as background data (to shapefile), then Make Read only for the Streets layer.
  5. Click Next. The Get Data For ArcPad - Select Picture Options dialog box appears.
  6. Click Next. Type Poles as the AXF folder (and subsequently, file name) and map name. Save it to a designated folder.
  7. Click Next. The Get Data For ArcPad - Select Output Options dialog box appears. See the following screen shot:
    Screen shot showing the Get Data For ArcPad - Select Output Options dialog box.
  8. Click Next. The Get Data For ArcPad - Select Deployment Options dialog box appears.
  9. Select the Create the ArcPad data on this computer now radio button.
  10. Click Finish. A new AXF file is created.

    If no AXF file is visible in the output folder, follow the Get Data for ArcPad wizard again and ensure that you selected Check Out for disconnected editing in ArcPad for the Poles layer. Also, confirm no errors are reported in the summary dialog box at the end of the wizard.

  11. Review the contents of the new Poles folder, which contains Riverside_mdb.axf and the Streets shapefiles. See the following screen shot:
Screen shot showing the files in the Poles folder.

Creating an Edit form for the Poles layer

NoteNote:

The checkout tool automatically creates an Edit form for each layer inside an AXF file during the checkout process. The following steps show how to create an Edit form from scratch. Normally, it is easiest to start with the Edit forms created during the checkout process and modify them to suit your needs.This section demonstrates how you can create a new Edit form.

Steps:
  1. Start ArcPad Studio and open the Riverside_mdb.axf file.
  2. Right-click the Poles feature layer and click Edit Layer Definition. The Layer Definition window appears. See the following screen shot:
    Screen shot showing Poles.axf and the Edit Layer Definition option.
    Screen shot showing the layer definition tree view for the Poles layer.
  3. Click the Forms Forms button button on the toolbar. The Forms dialog box appears. Forms created during checkout are listed. In the following screen shot, an Edit form and a Query form shows:
    Screen shot showing the Forms dialog box.
  4. Before creating a new Edit form, you must first delete the existing Edit form. Select the Edit form from the list and click Delete.
  5. To create a new Edit form for the Poles layer, click the EDITFORM button on the Forms dialog box. An Edit form dialog box appears with the Controls and Fields palettes. The Fields palette is a collection of smart controls for all the Poles layer fields. Each smart control has the associated field name listed next to it. See the following screen shots:
    Screen shot showing the Controls palette.
    Screen shot showing the Fields palette.
  6. Click the Form menu and click Form Properties. The Form Properties dialog box appears.
  7. Use this dialog box to make changes to the form's properties. For example, if you do not want all pages to be visible, clear the Symbology Page and Attributes Page check boxes. Type Poles in the Caption text box. Click OK. Notice, the caption changes to Poles. See the following screen shot:
    Screen shot showing the Form Properties dialog box.
  8. Click the Label control Label control button button on the Controls palette and drag it to the Edit form.
  9. The Control Properties dialog box for the Label control is visible after you drop the control on the page. Type lblPOLEID in the Name text box and Pole ID in the Caption text box. You can resize and change the placement of a control manually in the form editor or by changing properties on the Control Properties dialog box. See the following screen shot:
    Screen shot of the Control Properties dialog box.
  10. Type 30 in the Width text box and 12 in the Height text box to change the width and height properties. For the X and Y placement options, you will manually align the controls with the existing controls on the page.
  11. Click OK to close the Control Properties dialog box.
  12. Click and drag the POLEID Edit control from the Fields palette to the page of your Edit form. See the following screen shots:
    Screen shot showing the Poles Edit form.
    Screen shot showing the POLEID Edit control on the Fields palette.
  13. Double-click the POLEID Edit control. The Control Properties dialog box appears. Type edbPOLEID in the Name text box. Type 80 in the Width text box and 12 in the Height text box. Notice, this Edit control is already associated to the POLEID field; therefore, there is no need to change the Field text box.
  14. Click OK to close the Control Properties dialog box. Click and drag another label control to the Edit form.
  15. Type lblINSTALLDATE in the Name text box and type INSTALL DATE in the Caption text box.
  16. Type 60 in the Width text box and 12 in the Height text box. See the following screen shot:
    Screen shot showing the Control Properties dialog box.
  17. Click OK.
  18. Click and drag the INSTALLDATE control from the Fields palette to the Edit form. See the following screen shot:
    Screen shot showing the INSTALLDATE control on the Fields palette.
  19. Type dtpINSTALLDATE in the Name text box. Type 80 in the Width text box and 14 in the Height text box. You'll manually align the position of the control on the form; therefore, leave the X and Y position as is. See the following screen shot:
    Screen shot of the Control Properties dialog box.
  20. The last field you want to add to the Edit form is the Material field. Drag and drop a Label control to the Edit form.
  21. Type lblMaterial in the Name text box and Material in the Caption text box.
  22. Type 30 in the Width text box and 12 in the Height text box. See the following screen shot:
    Screen shot showing the Control Properties dialog box.
  23. Click OK to close the dialog box.
  24. Click and drag the Material DomainField control from the Fields palette to the form.
    NoteNote:

    Coded value domains (CVD) are used to enforce data integrity for the Material and Manufacturer fields in the source geodatabase (Riverside.mdb). These CVDs are acknowledged during the ArcPad checkout, stored in the AXF, and bound to their associated fields. The field controls for the Material and Manufacturer fields are called DomainField controls. DomainField controls show as combo boxes with predefined values. While editing a field with a DomainField control in ArcPad, you can only choose values from a selection list.

  25. Type dmfMaterial in the Name text box. Type 80 in the Width text box and 14 in the Height text box. See the following screen shot:
    Screen shot showing the Control Properties dialog box.
  26. Click OK to close the dialog box. Manually align the controls on the page.

Modifying the form's pages

Steps:
  1. Click the Page menu and click Page Properties. The Page Properties dialog box appears. This dialog box is used to gather information about poles.
  2. Type Pole Information in the Caption text box. See the following screen shot:
    Screen shot showing the Page Properties dialog box.
  3. Click OK to close the dialog box. The Poles form resembles the following screen shot:
    Screen shot showing the Poles form dialog box.
  4. Click OK to close the form and click OK to close the Forms dialog box.
  5. Click the Save button Save button on the toolbar to save the form's layer definition.

Creating a custom Query form for the Poles layer

The Poles Query form helps field personnel to find poles installed on a specific date or within a specific time frame. You will create a Query form similar to the following screen shot:

Screen shot showing the Poles Query form dialog box.

Steps:
  1. Double-click the <FORMS> element in the tree view of the layer definition. The following screen shot shows the tree view: Screen shot showing the layer definition tree view for the Poles layer.
  2. When the forms wizard opens, click the QUERYFORM button. A new Query form appears.
  3. Click the Form menu and click Form Properties. The Form Properties dialog box appears.
  4. Type Find Poles in the Caption text box. Type 100 in the Height text box. Leave the default Width as 130.
  5. Clear the Page Tabs check box if you are creating a single page Query form. See the following screen shot:
    Screen shot showing the Form Properties dialog box.
  6. Click OK.
  7. Drag a Label control Label control from the Controls palette to your Query form. The Control Properties dialog box appears when you drop the control on the form.
  8. Type Select Poles installed between in the Caption text box. Type 100 in the Width text box and 12 in the Height text box. See the following screen shot:
    Screen shot showing the Control Properties dialog box.
  9. Click OK.
  10. Drag the INSTALLDATE DateTime control from the Fields palette, then drop it on the form. See the following screen shot:
    Screen shot showing the Find Poles form.
  11. Double-click on the DateTime control. The Control Properties dialog box appears.
  12. A Query tab is added to the Control Properties for the Query form. Click the Query tab and choose the >= Value Operator option. See the following screen shot:
    Screen shot showing the Control Properties dialog box.
  13. Click OK.
  14. Add another Label control to the Query form. The Control Properties dialog box appears when you drop the control on the form.
  15. Type and in the Caption text box. Type 30 in the Width text box and 12 in the Height text box.
  16. Click OK to close the Control Properties dialog box. See the following screen shot:
    Screen shot showing the Find Poles form.
  17. Add another INSTALLDATE DateTime control to the form, double-click the second DateTime control.
  18. Choose the <= Value Operator option for this control. See the following screen shot:
    Screen shot showing the Control Properties dialog box.
  19. Click OK. Manually align the controls on the form. See the following screen shot of the created Query form:
    Screen shot showing the Find Poles Query form.
  20. Click OK to close the Query form and click OK to close the form dialog box. Save your changes before closing the layer definition tree view window.

Changing the Poles layer icon

Steps:
  1. Right-click the Poles feature layer in the AXF tree view window. Choose Set Layer Icon. See the following screen shot:
    Screen shot showing the Set Layer Icon option.
  2. Navigate to the sample Layer Icons folder. On Windows XP this is usually C:\Documents and Settings\All Users\Documents\ArcPad\Samples\Layer Icons, on Windows 7 this is usually C:\Users\Public\Documents\ArcPad\Samples\Layer Icons. Choose Street_Light.ico. See the following screen shot:
    Screen shot showing the Street_Light.ico file.
  3. Click Open. The Poles layer icon is automatically added to the tree view. See the following screen shot:
    Screen shot showing the Poles layer icon in the tree view.
  4. Close the tree view window.

2/7/2013