Comments (4.4)

This article applies to versions 4.4 and later of P2 Explorer. For the latest help, see Comments

Overview

Both the Comments and Comments Button components are designed to provide a way for users to capture comments related to a specific entity, within a specified context.

  • The Comments component displays a box that shows the comments related to an entity and context, and also allows users to add further comments.
  • The Comments Button displays a small icon which, when clicked, launches a window that allows users to enter and view comments.

The comments are stored in P2 Server and can be viewed anywhere in Explorer where the same entity and context are used.

Related: Using comments for collaboration in display mode, Comments: Communicating with ContextComments Button tutorial

 


Comments

The Comments component displays a box that allows users to add and view comments for an entity and context, within a specified time range. Users cannot change that time range.

Comments 4.4


Comments Button

The Comments Button component allows you to position a small icon (commenticonempty or image024) that users can click to see and add comments for an entity and context.

TOP TIP

If you want to position the comments button very close to another component, you need to use the Precision Layout. If you drag a Precision Layout onto a grid cell, then you will be able to move the 'set' of components easily, by moving the grid cell around.

 

The white icon indicates that no comments have yet been made for that entity and context, whereas the black icon indicates that comments have already been made. When the button is clicked, a floating comments window appears. 

Comments 4.4

Users can add and view comments for an entity and context, within a specified time range. Users cannot change that time range. However, users can search for additional comments within other time ranges, but cannot add comments against those other time ranges.

 


Configuring Comments 

Both the Comments and Comments Button components have the same configuration options. There are 2 configuration modes. Basic mode (shown below) shows the options most commonly used. Advanced mode allows you to change the type of properties used.

Basic Mode

Comments 4.4

Start Date/Time: The date/time from which to display comments. This will be entered as the start of the search date range.
End Date/Time: The date/time at which to stop displaying comments. This will be entered as the end of the search date range.
Entity: The entity that all these comments apply to. All comments entered in this box will apply to this entity.
Context: The situation in which these comments apply. All comments will have this context. If another comment box is placed on another page, with this same context and for the same entity, the comments for both will appear in both comment boxes. If the entity is the same but the context is different, the comments will be shown independently.
Style: The style you want to apply to the Comments component. There are no predefined styles available.

Advanced Mode

In Advanced mode, you have the option of switching between variable and text fields. The first 3 fields are set to variables initially, and have default values associated with them.

Comments 4.4

 

Related: Variables, Default Values


What is Context?

Context is the mechanism by which P2 Explorer exposes all comments related to a specific entity, and this is something that the page designer does when creating a page.

A comment’s context is some extra information that is added to the comment, and is used to associate comments with other comments for that entity that use the same context.

As an entity can be used on lots of different pages, adding context to a comment means that you can see  all of the comments that have been made for that entity with that context, every time you open the comments box, no matter which page you are looking at.

All comments have the context that is specified by the page designer for that component. For example, if the comments all have the context of “Report”, Explorer can apply filtering to all the comments in the system to only show comments for an entity with the "Report" context. 

Taking this a step further, a page designer can use the same context for the same entity on a completely different page. When a comment is applied to that entity, users will see all comments for that entity and context (e.g. Report), even though they are displayed on different pages.

 SEE IT IN ACTION! Watch this video to see how comments with context work on a page.


Tutorial: How Context Works with Comments

If you're unfamiliar with the process of building pages, read the article Building an Explorer Page.

In this tutorial, we’ll look at adding some Comments to a page, along with an Entity Selector that can change the entity that comments apply to. You will be able to enter comments and see how the context affects what is displayed.

Comments 4.4

Let’s go through this process, step-by-step.

Note: This configuration uses the Sample Data table and datasets that can be optionally made available during initial installation and setup. If you don't have access to this data, you will need to adjust the configuration to suit your data at your site.


Step 1. Prepare a Studio Page

New Page button on ribbon

Before you start, click the New Page button on the Home tab of the ribbon. Choose the Grid layout.

Grid Layout 4.4

Let's set up the page in this format: 

  • Create 4 columns.
  • Create 3 rows.
  • Set the heights of the first 2 rows to 50.

Related: Grid Layout tutorial

 

Step 2. Add and Configure an Entity Selector

Comments 4.4

The entity that the user selects from here will determine the entity that the comments apply to.

Drag and drop an Entity Selector to the bottom-left cell. Configure it as follows: 

  • Select Mode: Single
  • Selected Entity: selectedEntity
  • Hierarchy Name: (Text) P2 Energy Solutions
    Note: You will need to adjust the configuration to suit your data at your site.

Related: Entity Selector tutorial 

 

Step 3.  Add and Configure 3 Comments

Comments 4.4

Drag and drop 3 Comments components onto the remaining cells in the bottom row. The Comments component is in the Display Display group icon group.

Notice that the Entity field is already configured to be driven from the Entity Selector, so you only need to configure the Context field for each one.

  • Configure the left-most Comments as follows:
    • Context: (leave this blank)
      Leaving this blank will show all of the comments regardless of context.
  • Configure the Comments in the middle as follows:
    • Context: 1
  • Configure the right-most Comments as follows:
    • Context: 2

 

Step 4. Add and Configure 3 Comments Buttons

Comments 4.4 

Drag and drop 3 Comments Button components onto the cells above the Comments components.

Notice that the Entity is already configured to be driven from the Entity Selector, so you only need to configure the Context field for each one.

  • Configure the left-most Comments Button as follows:
    • Context: (leave this blank)
  • Configure the Comments Button in the middle as follows:
    • Context: 1
  • Configure the right-most Comments Button as follows:
    • Context: 2

 

Step 5. Add and Configure 3 Text Labels

Comments 4.4

This step is just to make it easier to remember what's what when you practice using the page at the end. We want to add a text label that displays the name of the entity and the context.

Related: Text Label tutorial, Data Selector

Drag and drop 3 Text Label components onto the cells above the Comments Buttons. Configure the first Text Label as follows:

  • In the Content area for the buttons, type Entity:
  • Click Add Data. We're going to add the selectedEntity variable here.
    • For the Type, choose Entity.
    • For Data, click the field to use the Data Selector. Staying on the Value Data Selector 4.4 tab, click the Variable Variable 4.4 button, and choose selectedEntity from the drop-down list. Click out of the Data Selector and click Add.
      Text Label 4.4
  • Staying in the Content area, after the entity variable, type: , Context: null
  • Your content should now look like this: Entity: {{1:entity:displayName}}, Context: null
    Note
    : You cannot type {{1:entity:displayName}} directly into the field as the database will not understand which data item to connect to. This must be done through the Data Selector.

Configure the remaining text labels as above, but specifying 1 and 2 for the context, corresponding to the context for that column.

 

Step 6. Configure Default Values

Comments 4.4

In this step, we want to configure a default value for the entity, so that the page makes sense when it's first loaded. 

  • Click the Default Values button above the component editor (top right).
  • For selectedEntity, type the name of a relevant entity from the hierarchy configured through your Entity Selector (e.g. Bossier 11).

Related: Default Values

 

Step 7. All done!  

Comments 4.4

Congratulations! You now have a page with an entity selector that chooses an entity, and Comments and Comments Buttons where you can add and view comments for that entity.

  • Click the Finish and Open livemode button on the Studio toolbar to save your page and open it in run-time.
  • Add some comments, using both the Comments Buttons and the Comments. 
  • Observe where the comments appear.

save Don’t forget to save your page!

Leave a Reply

Your email address will not be published. Required fields are marked *