Exercise 2: Using the InfoPath Web Part

In this exercise you will use the Employees list form created in the last exercise to create a main page for the site using Web Parts and Web Part Connections.

Task 1 – Add the Web Parts to the site’s main page

In this task, you will place two web parts on the main page. The first is a list of all Employees using the list web part and the second is a read-only version of the InfoPath form created in the first exercise.

  1. Add the List web part to the site’s main page
    1. In Internet Explorer navigate to https://intranet.contoso.com/sites/InfoPath
    2. In the Page ribbon tab click the Editpage button
    3. In the left hand side web part zone, click the Add a Web Part link
    4. In the Categories pane, select the Lists and Libraries category
    5. Choose the Employees web part and click the Add button

      Figure 18

      Add List Web Part

    6. Enter the web parts edit menu by clicking the web part’s drop down menu and clicking Edit Web Part
    7. In the Edit pane choose a Selected View of Summary
    8. Choose a Toolbar Type of No Toolbar
    9. Click OK to close the Edit pane
  2. Add the InfoPath Form Web Part to the right hand side web part zone
    1. In the right hand side web part zone, click the Add a Web Part link
    2. In the Categories pane, select the Forms category
    3. Choose the InfoPath Form Web Part and click the Add button
    4. In the new web part click the Click here to open the tool pane link
    5. In the List or Library drop down, choose the Employees list
    6. Check the Display a read-only form checkbox
    7. Uncheck the Show InfoPath Ribbon or toolbar checkbox

      Figure 19

      Edit InfoPath Web Part

    8. In the Appearance section, choose None in the Chrome Type drop down list
    9. Click OK to apply the changes

      Figure 20

      Complete Site Page

Task 2 – Connect the list and the InfoPath Form Web Part

In this task, you will connect the List web part to the InfoPath web part. This connection will allow the InfoPath form to display the details of the customer selected in the List web part.

  1. Define the connection between the two web parts
    1. Click the drop down arrow on the InfoPath Form web part
    2. Choose Connections -> Get Form From -> Employees

      Figure 21

      Connections Menu

    3. Save the page by clicking the Stop Editing button in the Page ribbon tab

Exercise 2 Verification

In order to verify that you have correctly performed all steps of Exercise 2, proceed as follows:

Test the Form

Test your form to verify it is use to add or edit items in the Employees list.

  1. Load the site’s main page in the browser
    1. In Internet Explorer navigate to https://intranet.contoso.com/sites/InfoPath
    2. Select an employee in the Employees list of the page
    3. Verify the InfoPath form is populated with the selected employee’s information

      Figure 22

      Connected Site Page