Constructing the OAContractorView Part


OAContractorView composition illustration

Before you can construct this part, you must have constructed the OAContractorPage1, -2, and -3 parts. To finish construction, you must also have constructed OAClearConfirmation and OASaveConfirmation.

  1. Create a visual part as follows:

    The part opens in the Composition Editor with one page set.

  2. Set this first notebook page as follows:

  3. Add a notebook page after ContactPage and set it as follows:

  4. Add a notebook page after HistoryPage and set it as follows:

  5. Delete the canvas part that appears on each notebook page.

  6. Add the following parts to notebook pages as follows:

  7. In the ButtonBar part, add and edit the buttons so that they appear in the following order. To even out button size, set the packType property of ButtonBar to expanded. If necessary, use the parts list to reorder the buttons.

    Table 17. Button Parts for OAContractorView
    Name it... Change label to read...
    OkPB OK
    RefreshPB Refresh
    ClearPB Clear
    CancelPB Cancel

    Set OkPB as the default button.

  8. To manage data in the notebook pages, add a Variable part. Set it as follows:

  9. To handle event dependency upon multiple values, add an IVBLogicalAndPart* part. Name it ANDgate. In this case, we will use ANDgate to selectively enable the Refresh push button only when the name fields are filled in.

  10. To handle data access exceptions, add an IMessageBox* part; name it NotFound.

  11. Promote the this attribute of the Contractor variable.

  12. Select the Contact page and connect parts as follows. The connection from CancelPB to the IFrameWindow* part was drawn when you created the part. For simplicity's sake, this table assumes that it is the first connection (conn0).

    Table 18. Connections for the OAContractorView Contact Page
    Connection number From Part, feature... To Part, feature...
    1 Contractor, lastName ContactPage, lastNameEFText (text attribute promoted from LastNameEF)
    2 Contractor, firstName ContactPageClient, firstNameEFText
    3 Contractor, middleInitial ContactPageClient, middleInitialEFText
    4 Contractor, homeStreet ContactPageClient, streetEFText
    5 Contractor, homeCity ContactPageClient, cityEFText
    6 Contractor, homeState ContactPageClient, stateEFText
    7 Contractor, homeZip ContactPageClient, zipEFText
    8 Contractor, phoneNumber ContactPageClient, phoneEFText
    9 ContactPageClient, firstNameEFTextLength ANDgate, input1
    10 ContactPageClient, lastNameEFTextLength ANDgate, input2
    11 ContactPageClient, middleInitEFTextLength ANDgate, input3
    12 ANDgate, value (the result of logically ANDing the three input values) RefreshPB, enabled
    13 RefreshPB, buttonClickedEvent Contractor, getContractor
    14 conn13, aContractorID Contractor, contractorID
    15 conn13, exceptionOccurred NotFound, showException

  13. Select the History page and add a part of type OAContract*; name it Contract.

  14. Drop one each of Factory and Variable parts. Give them both a type of OAContractView*. Name them OAConViewFac and OAConViewVar, respectively.

  15. Connect parts as follows:

    Table 19. Connections for the OAContractorView History Page
    Connection number From Part, feature... To Part, feature...
    16 Contractor, startDate HistoryPageClient, startDateEFText
    17 Contractor, endDate HistoryPageClient, endDateEFText
    18 Contractor, accountNum HistoryPageClient, contractEFText
    19 Contractor, activeStatus HistoryPageClient, activeStatusCBSelected
    20 HistoryPageClient, contractEFText Contract, accountNum
    21 HistoryPageClient, browsePBButtonClickEvent Contract, getContract
    22 conn14, anAccountNum Contract, accountNum
    23 conn14, exceptionOccurred NotFound, showException
    24 Contract, this OAConViewFac, contract
    25 Contract, queryFound OAConViewFac, new
    26 OAConViewFac, newEvent OAConViewVar, this
    27 OAConViewFac, newEvent OAConViewVar, setFocus
    28 OAConViewFac, newEvent OAConViewVar, show

  16. Select the Skills Page and add one each of OASkill* and OASkillBase* parts. Name them Skill and SkillBase, respectively.

  17. Connect parts as follows:

    Table 20. Connections for the OAContractorView Skills Page
    Connection number From Part, feature... To Part, feature...
    28 Contractor, contractorID Skill, contractorID
    29 SkillsPageClient, skillNameCBText Skill, skillName
    30 SkillsPageClient, yearMSBValueAsString Skill, yearsExp

  18. Add two each of Factory and Variable parts.

    Name the first factory-variable pair OASaveConfirmationFac and OASaveConfirmationVar, respectively. Give them both a type of OASaveConfirmation*.

    Name the second pair OAClearConfirmationFac and OAClearConfirmationVar, respectively. Give them both a type of OAClearConfirmation*.

  19. Connect parts as follows. (As stated previously, we assume that VisualAge has already drawn the CancelPB connection (conn0)). Connections for RefreshPB were listed previously.

    Table 21. Connections for the OAContractorView Button Bar
    Connection number From Part, feature... To Part, feature...
    31 OkPB, buttonClickEvent OASaveConfirmationFac, new
    32 OASaveConfirmationFac, newEvent OASaveConfirmationVar, this
    33 OASaveConfirmationFac, newEvent OASaveConfirmationVar, setFocus
    34 OASaveConfirmationFac, newEvent OASaveConfirmationVar, show
    35 OASaveConfirmationVar, yesPBButtonClickedEvent Contractor, putContractor
    36 OASaveConfirmationVar, yesPBButtonClickedEvent SkillBase, putSkill
    37 conn36, aSkill Skill, this
    38 OASaveConfirmationVar, yesPBButtonClickedEvent FrameWindow, close
    39 ClearPB, buttonClickEvent OAClearConfirmationFac, new
    40 OAClearConfirmationFac, newEvent OAClearConfirmationVar, this
    41 OAClearConfirmationFac, newEvent OAClearConfirmationVar, setFocus
    42 OAClearConfirmationFac, newEvent OAClearConfirmationVar, show
    43 OAClearConfirmationVar, yesPBButtonClicked Skill, clear
    44 OAClearConfirmationVar, yesPBButtonClicked Contractor, clear
    45 OAClearConfirmationVar, yesPBButtonClicked OAClearConfirmationVar, close


Related procedures
Constructing the OAContractorPage1 Part
Constructing the OAContractorPage2 Part
Constructing the OAContractorPage3 Part
Constructing the OAClearConfirmation Part
Constructing the OASaveConfirmation Part
Working with Parts in the Composition Editor
Editing Part Properties
Dropping Parts in the Composition Editor
About Promoting Part Features
Making Connections in the Composition Editor

Related references
Factory
INotebook
Variable