Define extended attribute information

Note

Now you extend the basic definitions of the columns in the table.

The following table summarizes how you extend the column definitions of the contact1 table columns.

Column name

What you do to extend its definition

id

last_name

first_name

Nothing.

title

Define a DropDownListBox edit style of job roles, change the column header and label to Job Role, and enlarge the display width of the column to 1.5 inches.

street

city

Nothing.

state

Assign the DropDownDataWindow edit style for state to the state column.

Set the default value of state to MA.

zip

Nothing.

phone

fax

Define an Edit Mask edit style for a phone number and apply it to phone and fax.

NoteAbout extended attribute information InfoMaker stores extended attribute information in the extended attribute system tables and uses it to display and validate data in forms and reports. In the Report painter or Form painter, you can override whatever you specified in the Database painter, which is where you are now.

Define a DropDownListBox edit style for the title column

Now you define a DropDownListBox edit style that has the valid job roles for the title column. When you have finished, this is what it looks like in a form.

Shown is a sample drop down list box. At the top is a text box displaying the selection Marketing and a down arrow. Underneath the text box is a scrollable drop down list of choices, and Marketing is the selection highlighted in the list.
  1. Select View>Layouts>(Default) from the menu bar.

  2. Click the Extended Attributes tab to bring the view to the front.

  3. In the Extended Attributes view, display the pop-up menu for Edit Styles and select New.

    Shown is the Extended Attributes tab in the center of the Database painter work space. Of the extended attributes displayed, Edit Styles is selected, and a pop up menu displays the options New, Refresh, and Properties.

    Edit Style settings display in the Object Details view.

    Shown is the Edit Style dialog box. It has a Name text box and Style drop down at the top, then an options group box with boxes for Limit, Case,  Accelerator, and Format, and many check boxes for various options.
  4. Enter the name JobRoles1.

    Select DropDownListBox in the Style Type box.

    Check Sorted to alphabetize your entries.

    Check Vertical Scroll Bar to display a vertical scroll bar on your list.

    Shown is the Edit Style dialog box. It has a Name text box entry of Job Roles 1, a Style drop down entry of Drop Down List Box. Under options, the Sorted and Vert Scroll Bar options are checked. Limit is set to 0 and Case is set to Any.  Under the Options group box is an area for entering Dispaly and Data Values.
  5. Enter the Display Values and Data Values shown in the table below.

    Be sure to use lowercase for the data values.

    To enter each pair of values, type the values and press the Tab key.

    For the last pair of values, do not press Tab.

    Display Value

    Data Value

    Sales

    sa

    Customer support

    cs

    Product development

    pd

    Administration

    ad

    Training

    tr

    Documentation

    do

    Marketing

    ma

    Human resources

    hr

    Finance

    fi

    Other

    ot

    NoteAbout display values and data values Display values show in forms and reports. Data values are stored in the database. Display values should be meaningful—such as Human Resources. In contrast, data values are often codes that are short—such as hr. Short codes conserve space in the database.

  6. Select Save Changes from the pop-up menu.

    InfoMaker adds the JobRoles1 edit style to the extended attribute system tables in the database and lists it as one of the available edit styles in the Extended Attributes view.

  7. Expand the tree view of Edit Styles by clicking the plus (+) sign.

    Use the scroll bar to scroll down to the JobRoles1 Edit Style.

    Shown is the expanded tree view of Edit Styles as it appears in the Extended Attributes view. A rectangle is drawn around the new entry Job Roles 1.

    Now that JobRoles1 is defined in the extended attribute system tables, you can use it for any appropriate column in any table in the database. You are going to assign it to the title column in the contact1 table.

  8. Expand EAS Demo DB V115 IM in the Objects view to display Tables and then the Columns in the contact1 table.

    Display the pop-up menu for the title column and select Properties.

    The Object Details view now includes the properties dialog box for the title column.

    Shown at left is the expanded Objects view for contact 1. Under its columns folder is an entry for title and a pop up menu with a Properties option.
  9. If the Edit Style tab is not visible, use the arrows in the upper-right corner of the Object Details view to display the Edit Style tab.

    Click the Edit Style tab to bring it to the front.

    Shown is the Edit Styles tab of the Objects Details view at the right of the Database painter screen. It displays a list of Style Names.
  10. Scroll the list of edit styles until JobRoles1 displays.

    Click it to apply the edit style JobRoles1 to the title column.

    Select File>Save from the menu bar.

Change the column header, label, and display width of title

Now you change the label and header text for the title column. The text you supply appears on forms and reports you create.

The column name is title, but the text you want to display is Job role. Also, you change the display width to 1.5 inches. The internally stored data value is only two characters, but the values you intend to display are longer.

  1. The title column should still be current (if not, display its pop-up menu and select Properties). Click the Headers tab to bring the Headers property page for the title column to the front in the Object Details view.

    All the extended attribute information for a column is definable using the various pages in the Object Details view.

  2. Type Job Role in the Label box.

    Type Job Role in the Heading box.

    Shown is the Headers tab of the Objects Details view. It displays a group box titled Label with the entry Job Role in a Label text box, and a Position drop down set to left. Next is a Heading group box with a scrollable Heading box sshowing the entry Job Role and a Position drop down set to center.
  3. Click the Display tab to bring the Display page to the front.

    Type 1.5 in the Display Width box.

    Shown is the Display tab of the Objects Details view. It has a drop down for Display Format set to None and a justify drop down set to left. Next are a Display Height text box with the entry 0 point 1 6 6 and a Width box with the entry 1 point 5. Last are a Case drop down set to None and a cleared check box labeled Picture.
  4. Select File>Save from the menu bar.

    InfoMaker adds the extended attribute information for the column to the extended attribute system tables.

Assign a DropDownDataWindow edit style and initial value to state

For the state column, you assign an edit style that includes all the state names (as well as the provinces of Canada). Then when you enter information into this field, you pick from a list of states. You also set the initial value to MA, since many of your contacts are in Massachusetts.

  1. In the Extended Attributes view, display the pop-up menu for Edit Styles and select New.

    Shown is an expanded tree view in the Extended  Attributes. The Edit Style entry is highllighted and its pop up menu has the New option selected.

    Edit Style settings display in the Object Details view.

    Shown is the Edit Style dialog box. It has a Name text box and Style drop down at the top, then an options group box with boxes for Limit, Case,  Accelerator, and Format, and many check boxes for various options.
  2. Type StateCode1 in the Name box.

    Select DropDownDW from the Style Type drop-down list.

    Shown is the Edit Style dialog box. It has a Name text box and Style drop down at the top, then an options group box with boxes for Limit, Case,  Accelerator, and Format, and many check boxes for various options.
  3. Scroll down to the bottom of the view and click the browse button next to the DataWindow box.

    Select d_dddw_states from the DataWindow list.

    The StateCode1 edit style uses a report (DataWindow) named d_dddw_states. The report gets its values from the state table.

    Shown is the Edit Style dialog box. It has the entries State Code 1 for Name and Drop Down D W for Style. The Data Window drop down at the top of the Options group box displays a list of choices, and highlighted is the entry d _ d d d w _ states.

    NoteAbout DropDownDataWindow edit styles A DropDownDataWindow edit style gets its values from a report that it references. The report gets its values from the database.

    This is what the d_dddw_states report looks like.

    Shown is the d _ d d d w _ states report. It is a table with three columns labeled I D, Name, and Country and rows of data that are alphabetically ordered by I D, such as A B Alberta Canada followed by A K Alaska  U S A.
  4. Select state_id from the list for Display Column and for Data Column.

    Type 550 for the Width of DropDown.

    Select Vertical Scroll Bar.

    Select Save Changes from the pop-up menu to accept the definition of the StateCode1 edit style.

    Shown is the Edit Style dialog box. It has the entries State Code 1 for Name and Drop Down D W for Style. In the Options group box are the entries d _ d d d w _ states for Data Window, state _ i d for Display Column, and state _ i d for Data Column. The Width of drop down text box has the etnry 550 %, and the V Scroll Bar check box is checked.

    InfoMaker adds the StateCode1 edit style to the extended attribute system tables, where it is available to be assigned to any appropriate column in the database. Now you assign it to the state column in the contact1 table.

  5. Display the pop-up menu for the state column in the contact1 table and select Properties.

    Shown is the database painter with the tree view at left expanded under contact 1 and the columns folder to show the highlighted state column. A pop up menu offers the options Edit Column, Drop Column, and Properties.
  6. In the Column Properties view, select the Edit Style tab.

    Select StateCode1 for the edit style to assign to the state column.

    (If the StateCode1 edit style is not listed, select View>Reset View. This refreshes the list of edit styles.)

    Shown is the Edit Style tab of the Column Properties view. It shows a drop down list of available Style Names such as Status Buttons, with the State Code 1 style highlighted.

    This assigns the StateCode1 edit style (which includes 63 entries—states, territories, and possessions of the United States and provinces of Canada) to the state column in the contact table. The values that this edit style displays and the values that it stores are state postal abbreviations (such as MA for the state of Massachusetts).

  7. Select File>Save from the menu bar.

  8. Click the Validation tab.

    Make sure the Validation Rule setting is (None).

    Type MA in the Initial Value box.

    This assigns an initial value of MA to the state column.

    Shown is the Validation tab of the Column Properties view. It shows a drop down list for Validation Rules with the entry ( None ) and a drop down for Initial Value with the entry M A.

    The Validation page lets you create and assign a validation rule to a column and enter an initial value for the column.

    You are not going to assign a validation rule. You have handled validation by forcing the user to select from exactly 63 valid values presented in the States drop-down DataWindow.

    NoteAbout column validation rules You can use column validation rules to express requirements for entries in a column. For example, you could define a rule for a salary column that requires salaries to be greater than $15,000 and less than $100,000.

    When you assign a column validation rule to a column, no one can enter a value that breaks the rule.

  9. Select File>Save from the menu bar.

    InfoMaker saves the extended attributes you just defined for the state column in the extended attribute system tables.

Define an Edit Mask edit style for phone and fax

Now you define an Edit Mask edit style to display phone and fax numbers for both viewing and editing.

  1. In the Extended Attributes view, display the pop-up menu for Edit Styles and select New.

    Shown is the pop-up menu for Edit Styles in the Extended Attributes view. It offers the options New, which is highlighted, Refresh, and Properties, which is grayed.

    Edit Style settings display in the Object Details view.

  2. Type TelephoneNumber1 in the Name box.

    Select EditMask in the Style drop-down list.

    Delete xxx and type (###) ###-#### in the Mask box.

    Shown is the Edit Style dialog box. It has a Name text box entry of Telephone Number 1, a Style drop down set to Edit Mask, and a Mask box with the entry ( # # # ) # # # - # # # #.

    The pound signs (#) in the Mask box are placeholders for numbers. Only numbers 0 through 9 can be entered in each of these positions. Parentheses, the hyphen, and the space are where you want them to display. When you type a telephone number in the Test box, you can see the effects of the edit mask.

  3. Select Save Changes from the pop-up menu to accept the definition of the Edit Mask edit style named TelephoneNumber1.

    InfoMaker adds the TelephoneNumber1 edit style to the extended attribute system tables in the database and lists it as one of the available edit styles in the Extended Attributes view.

  4. Display the pop-up menu for the phone column and select Properties.

    Shown at left is the expanded Objects view for contact 1. Under its columns folder is the highlighted item phone and a pop up menu with Edit Column and Drop Column options and a Properties option that is highlighted.
  5. In the Object Details view, click the Edit Styles tab, then scroll the list and select the TelephoneNumber1 edit style.

    Shown is the Edit Style tab of the Object Details view with a list of Style Names with Telephone Number 1  highlighted.

    This assigns the TelephoneNumber1 edit style to the phone column. Now you use the same edit style with the fax column. Once you have created an edit style, it is available for any column.

  6. Display the pop-up menu for the fax column and select Properties.

    InfoMaker prompts you to save the changes you just made in assigning the TelephoneNumber1 edit style to the phone column.

  7. Select Yes.

  8. In the Object Details view for the fax column, select the Edit Style tab and the TelephoneNumber1 edit style.

    Select File>Save from the menu bar.

    Shown is the Database Painter with the fax column selected in the tree view at left, Edit Styles selected in the Extended Attributes view in the center, and the Edit Style tab displayed in the Object Details view at the left, with the Telephone Number 1 Style Name highlighted.

Now you have finished extending the definitions of your columns. Next you add data to the table.