Skip to content

sc-note-comment

1 Purpose

sc-note-comment places a note comment field on a form, allowing the user to enter a note and users to enter comments against that note.

The sc-note-comment definition provides fields for setting the properties of a note comment field and is fully described below.

2 Definition

sc-note-comment is defined by a set of name/value pair fields consisting of:

  • Required system fields
  • Required customizable fields
  • Optional customizable fields

Note:

  1. Default values for fields described in the tables below are shown in bold text.

2.1 Required System Fields

Field Valid Values Description
componentName sc-note-comment The component name.
Example: "componentName": "sc-note-comment"

2.2 Required Customizable Fields

Field Valid Values Description
name Any value written in camel case. Defines the name of the note comment field in the document and database.
Example: "name": "testScNoteComment"

2.3 Optional Customizable Fields

Field Valid Values Description
disableCommentFunction true Does not provide the ability to add a comment.
Example: "disableCommentFunction": "true"
false Default value. Provide the ability to add a comment.
disableSave true Entering a value in the note comment field does not trigger the Save icon to flash.
Exiting the form without saving the entered value does not trigger a warning message to display.
Example: "disableSave": true
false Default value. Entering a value in the note comment field does trigger the Save icon to flash.
Exiting the form without saving the entered value does trigger a warning message to display.
disableVoteFunction true Does not provide the ability to 'like' or 'dislike' the note.
Example: "disableVoteFunction ": true
false Default value. Provides the ability to 'like' or 'dislike' the note .
Exiting the form without saving the entered value does trigger a warning message to display.
enabled false The note comment field is greyed out.
A Stop icon appears on mouseover.
A value cannot be entered in the note comment field.
Example: "enabled": false
true Default value. A value can be entered in the note comment field e.g. "Orange".
fullWidth true The note comment field displays full width on the form.
Example: "fullWidth": true
false Default value. The note comment field does not display full width on the form.
label Any value Defines the name of the note comment field on the form i.e. the field label.
Example: "label": "Test sc-comment"
"name" field value Defaults to the value defined for the 'name' field, with the first letter displayed in upper case and any upper case letters displayed in lower case prefixed with an underscore.
Example: "Test_sc_note_comment" is the default value if the "name" field value was "testScNoteComment".
mandatory true The note comment field displays as mandatory (i.e. label in red text with an asterisk).
Saving without a value, a message prompts the user to enter a value for the note comment field.
Example: "mandatory": true
false Default value. The note comment field displays as optional (i.e. label in black text).
visible false The note comment field is not visible on the form.
Example: "visible": false
true Default value. The note comment field is visible on the form.

3 Typical sc-note-comment Definition

Below is a typical sc-note-comment definition, defined with its required fields plus any optional field whose value is typically other than its default value.

{
    "name": "noteDetails",
    "componentName": "sc-note-comment",
    "label": "Notes",
    "fullWidth": true,
    "disableCommentFunction": true,
    "disableVoteFunction": true
}

One or more of the optional fields shown below can be included in the above definition should a value other than their default value be required.

    "mandatory": true,
    "defaultValue": "This is the default Note",
    "disableSave":true,
    "enabled":false,
    "visible":false,

 

 

4 Examples

Example 1

sc-note-comment with only its required system fields and required customizable fields defined.

{
      "componentName": "sc-note-comment",
      "label": "Test sc-note-comment",
      "name": "testScNoteComment"
}

Resulting field on the form:

alt text

Resulting field on the form after entered data:

alt text

Resulting field in the document and database

    "testScNoteComment": [
        {
            "dataId": "3dd11700-aa1f-11e6-8884-43e5209d15c8",
            "detail": "This is Note 1",
            "createdBy": {
                "documentId": "b7c1e1b0-2b9f-11e6-ac9c-170c531a5a0c",
                "name": "hubzero"
            },
            "createdDate": "2016-11-14T04:03:03.921Z",
            "comments": [
                {
                    "dataId": "4fe21c81-aa21-11e6-be8d-bdd60ad6ab22",
                    "detail": "This is Comment 1",
                    "createdBy": {
                        "documentId": "b7c1e1b0-2b9f-11e6-ac9c-170c531a5a0c",
                        "name": "hubzero"
                    },
                    "createdDate": "2016-11-14T04:17:53.224Z"
                }
            ]
        }
    ]

Example 2

sc-text-box with its required fields and two optional fields ("mandatory", "disableCommentFunction") defined.

 

{
    "componentName": "sc-text-box",
    "label": "Test sc-text-box",
    "name": "testScTextBox",
    "mandatory": true
    "disableCommentFunction": "true"
}

Resulting field on the form:

alt text