Example: showing the label of a complex view

This example shows how to show the label of a complex view in the coach or view that contains it.

When you add simple views to a coach or to another view, you automatically see their label at design time and at run time. This is not the case for complex views, which contain multiple views. When you add complex views to a parent view or coach, there is nowhere to show their labels by default. However, you can still show their labels by using the label general configuration option.

In this example, you create the My Complex CV view with two text views and a text area view. You then modify it so that you can see its label at run time. The example uses a client-side human service and views.

  1. Create a view that is called My Complex CV and add two text views and a text area view to it. You can use default values for the views.
  2. Create a client-side human service that is called My Human Service.
    The completed flow of My Human Service
  3. Open Coach using the default option and add My Complex CV to it. The following table shows My Complex CV within a coach at design time and at run time. In both cases, you cannot see the label for the view:
    My Complex CV in a coach in the Process Designer My Complex CV at run time
    The label of the view is not visible at design time
    The label of the view is not visible at run time
  4. To make the view label visible at design time:
    1. Open the My Complex CV view.
    2. In the Overview page, select Supports a Label.
    3. Click Save or Finish Editing.
    4. If you open My Coach in the human service, you can now see the label for My Complex CV.
      My Complex CV with its label now visible
  5. To make the label visible at run time:
    1. Open the My Complex CV view.
    2. In its layout, add an output text view.
      My Complex CV layout with an output text view added to it.
    3. In the General properties of the output text view, click Assign variable for the Label field and then clickSelect. In the window that opens, expand General Options and then select @label (String).
      Setting the label of the output text to the label general configuration option
      Using the label of the output text to display the view name means that, at run time, the name is styled as a label. If you instead set the binding to display the view, at run time, the name is styled as normal text.
    4. In the Visibility properties of the output text view, click Assign variable for the Visibility field and then clickSelect. In the window that opens, expand General Options and then select @labelVisibility (String).
      Setting the label visibility of the output text to the labelVisibility configuration option
    5. Click Save or Finish Editing.
  6. Test that you have bound the view label:
    1. Open My Human Service and open My Coach.
    2. Change the label of My Complex CV to My Complex CV Label.
    3. Click Save or Finish Editing.
    4. Run the human service. My Complex CV now shows the label that you give it in My Coach. The following table shows My Complex CV at design time and at run time.
      My Complex CV in a coach in the Process Designer My Complex CV at run time
      The label of the view is visible at design time
      The label of the view is now visible at run time