Constructing the Query Window Parts

The query window parts look similar to this:
OAQueryContract composition illustration

Constructing OAQueryContract

  1. Create a visual part as follows:

    The part opens in the Composition Editor.

  2. In the IFrameWindow* part, set the helpId property to 10001.

  3. For this part, the client area requires 5 rows and 3 columns. Make the following expandable:

  4. Add an IStaticText* part to cell (2,2). Change its label to read Enter a contract number below:

  5. Add an IEntryField* part to cell (4,2) and set as follows:

  6. To even out button size in ButtonBar, set the packType property of ButtonBar to expanded.

  7. To enable help, add an IHelpWindow* part. Set it as follows:

  8. To manage data in the IEntryField* part, add a Variable part. Name it Contract and give it a type of OAContract*.

  9. Promote the this attribute of the Contract variable.

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

  11. Add one each of Factory and Variable parts. Set the type of both to OAContractView*. Name them OAContractViewFac and OAContractViewVar, respectively. These parts will manage a dynamic instance of OAContractView in the finished application.

  12. 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 24. Connections for OAQueryContract
    Connection number From Part, feature... To Part, feature...
    1 AccountNumEF, text Contract, accountNum
    2 AccountNumEF, textLength okPB, enabled
    3 okPB, buttonClickEvent Contract, getContract
    4 conn3, anAccountNum accountNumEF, text
    5 conn3, exceptionOccurred NotFound, showException
    6 Contract, this OAContractViewFac, contract (the promoted variable from that part)
    7 Contract, queryFound OAContractViewFac, new
    8 Contract, queryFound FrameWindow, close
    9 OAContractViewFac, newEvent OAContractViewVar, this
    9 OAContractViewFac, newEvent OAContractViewVar, setFocus
    10 OAContractViewFac, newEvent OAContractViewVar, show


OAQueryContractor composition illustration

Constructing OAQueryContractor

  1. Create a visual part as follows:

    The part opens in the Composition Editor.

  2. In the IFrameWindow* part, set the helpId property to 10003.

  3. For this part, the client area requires 5 rows and 3 columns. Make the following expandable:

  4. Add an IStaticText* part to cell (2,2). Change its label to read Enter the contractor's name below:

  5. Add an IEntryField* part to cell (4,2) and set as follows:

  6. To even out button size in ButtonBar, set the packType property of ButtonBar to expanded.

  7. To enable help, add an IHelpWindow* part. Set it as follows:

  8. To manage data in the IEntryField* part, add a Variable part. Name it Contractor and give it a type of OAContractor*.

  9. Promote the this attribute of the Contractor variable.

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

  11. Add one each of Factory and Variable parts. Set the type of both to OAContractorView*. Name them OAContractorViewFac and OAContractorViewVar, respectively. These parts will manage a dynamic instance of OAContractorView in the finished application.

  12. 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 25. Connections for OAQueryContractor
    Connection number From Part, feature... To Part, feature...
    1 ContractorIDEF, textLength okPB, enabled
    2 okPB, buttonClickEvent Contractor, parseName
    3 conn2, aName ContractorIDEF, text
    4 okPB, buttonClickEvent Contractor, getContractor
    5 conn4, aContractorID Contractor, contractorID
    6 conn4, exceptionOccurred NotFound, showException
    7 Contractor, this OAContractorViewFac, contractor (the promoted variable from that part)
    8 Contractor, queryFound OAContractViewFac, new
    9 Contractor, queryFound FrameWindow1, close
    10 OAContractViewFac, newEvent OAContractViewVar, this
    11 OAContractViewFac, newEvent OAContractViewVar, setFocus
    12 OAContractViewFac, newEvent OAContractViewVar, show


OAQuerySkill composition illustration

Constructing OAQuerySkill

  1. Create a visual part as follows:

    The part opens in the Composition Editor.

  2. In the IFrameWindow* part, set the helpId property to 9999.

  3. For this part, the client area requires 5 rows and 3 columns. Make the following expandable:

  4. Add an IStaticText* part to cell (2,2). Change its label to read Enter a description of the skill below:

  5. Add an IEntryField* part to cell (4,2) and set as follows:

  6. To even out button size in ButtonBar, set the packType property of ButtonBar to expanded.

  7. To enable help, add an IHelpWindow* part. Set it as follows: TBD

  8. To manage data in the IEntryField* part, add a Variable part. Name it Skill and give it a type of OASkill*. Promote the this attribute of the Skill variable.

  9. Add an OASkillBase* part. Name it SkillBase.

  10. Add an IVSequence* part. Name it SkillList and set its element template argument to OASkill*.

  11. Add one each of Factory and Variable parts. Set the type of both to OASkillView*. Name them OASkillViewFac and OASkillViewVar, respectively. These parts will manage a dynamic instance of OASkillView in the finished application.

  12. 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 26. Connections for OAQuerySkill
    Connection number From Part, feature... To Part, feature...
    1 SkillNameEF, text Skill, skillName
    2 SkillNameEF, textLength okPB, enabled
    3 okPB, buttonClickEvent SkillBase, getSkill
    4 conn3, aSkillName Skill, SkillName
    5 conn3, aList SkillList, this
    6 SkillBase, queryFound FrameWindow1, close
    7 Skill, this OASkillViewFac, skill (the promoted variable from that part)
    8 SkillBase, this OASkillViewFac, SkillBase (the promoted variable from that part)
    9 SkillList, this OASkillViewFac, SkillList (the promoted variable from that part)
    10 SkillBase, queryFound OASkillViewFac, new
    11 OASkillViewFac, newEvent OASkillViewVar, this
    12 OASkillViewFac, newEvent OASkillViewVar, setFocus
    13 OASkillViewFac, newEvent OASkillViewVar, show


Related procedures
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
IHelpWindow
IMessageBox
Variable