---
category: [Administration & Integrations, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions/Workday Extend]
keyword: [Extend, PMD Scripting, Scripts]
nav: wcp_docs
parent_url: /wcp_docs/
title: >- 
  Reference: PMD Scripting Widget Methods
layout: subsection
---



## <a id="section_basicUIWidgetMethods"></a>Basic UI Widget Methods

Use these methods on instances of these basic widgets:

-   `checkBox`
-   `currency`
-   `date`
-   `hidden`
-   `number`
-   `richText`
-   `text`
-   `textArea`
-   `time`


<b>Note:</b> These methods also apply when you use basic widgets in containers such as the `cellTemplate` in a grid column.

-   <a id="dlentry_basicUiWidget_clearError"></a><b>clearError()</b>

    Return type: `void`

    Description: Clears the validation error.

-   <a id="dlentry_basicUiWidget_clearWarning"></a><b>clearWarning()</b>

    Return type: `void`

    Description: Clears the validation warning.

-   <b>getLabel()</b>

    Return type: `string`

    Description: Returns the widget label.

-   <a id="dlentry_basicUiWidget_getValue"></a><b>getValue()</b>

    Return type: `Object`

    Description: Returns the value of this widget.

-   <a id="dlentry_basicUiWidget_getValueOutBinding"></a><b>getValueOutBinding()</b>

    Return type: `string`

    Description: Returns the outbound value binding of this widget.

-   <b>isEnabled()</b>

    Return type: `boolean`

    Description: Returns true if this widget is enabled.

-   <b>isRequired()</b>

    Return type: `boolean`

    Description: Returns true if this widget is required.

-   <b>isUpdated()</b>

    Return type: `boolean`

    Description: If true, this widget is manually updated by the end-user.

-   <b>isUpdatedByScript()</b>

    Return type: `boolean`

    Description: If true, this widget is programmatically updated by a PMD script.

-   <b>isVisible()</b>

    Return type: `boolean`

    Description: Returns true if this widget is visible.

-   <b>setEnabled(boolean enabled)</b>

    Return type: `void`

    Description: Enables or disables this widget.

-   <a id="dlentry_basicUiWidget_setError"></a><b>setError(String error)</b>

    Return type: `void`

    Description: Sets the validation error. The input error message displays in the page error window.

-   <a id="dlentry_basicUiWidget_setLabel"></a><b>setLabel(String label)</b>

    Return type: `void`

    Description: Sets the widget label.

-   <b>setRequired(boolean required)</b>

    Return type: `void`

    Description: Makes this widget required or not required.

-   <a id="dlentry_basicUiWidget_setValue"></a><b>setValue(Object value)</b>

    Return type: `void`

    Description: Sets the value of this widget.

    For `date` widgets: When you set the value of a `date` widget to an empty value, specify `null` instead of an empty string. Example: `dateWidgetId.setValue(null)` or `dateWidgetId.value = null`.

-   <a id="dlentry_basicUiWidget_setValueOutBinding"></a><b>setValueOutBinding(String valueOutBinding)</b>

    Return type: `void`

    Description: Sets the outbound value binding to this widget.

-   <a id="dlentry_basicUiWidget_setVisible"></a><b>setVisible(boolean visible)</b>

    Return type: `void`

    Description: Displays or hides this widget.

    If you need to change the visibility of a widget, ensure that it's inside a `fieldSet`.

-   <a id="dlentry_basicUiWidget_setWarning"></a><b>setWarning(String warning)</b>

    Return type: `void`

    Description: Sets the validation warning.



<b>currency Methods</b>

These methods only apply to `currency`:

-   <b>getCurrencyCode()</b>

    Return type: `string`

    Description: Returns the currency code.

-   <b>setCurrencyCode(String currencyCode)</b>

    Return type: `void`

    Description: Sets the currency code, which is an uppercase (3-character) currency code.



<b>externalLink Methods</b>

These methods only apply to `externalLink`:

-   <b>getDescriptor()</b>

    Return type: `string`

    Description: Returns the text of the `externalLink`.

-   <b>getLabel()</b>

    Return type: `string`

    Description: Returns the widget label.

-   <b>getUrl()</b>

    Return type: `string`

    Description: Returns the url of the `externalLink`.

-   <b>isVisible()</b>

    Return type: `boolean`

    Description: Returns true if this widget is visible.

-   <b>setDescriptor(String descriptor)</b>

    Return type: `void`

    Description: Sets the text of the `externalLink`.

-   <b>setLabel(String label)</b>

    Return type: `void`

    Description: Sets the widget label.

-   <b>setUrl(String label)</b>

    Return type: `void`

    Description: Sets the url of the `externalLink`.

-   <b>setVisible(boolean visible)</b>

    Return type: `void`

    Description: Displays or hides this widget..

    If you need to change the visibility of an `externalLink`, ensure that it's inside a `fieldSet`.



<b>text Methods</b>

These methods only apply to `text`:

-   <b>getFormat()</b>

    Return type: `string`

    Description: Returns the format of the text widget.

-   <b>setFormat(String format)</b>

    Return type: `void`

    Description: Sets the format of the text widget.



.

## <a id="section_containerWidgetMethods"></a>Container Widget Methods

<b>section Methods</b>

-   <b>anyUpdated()</b>

    Return type: `boolean`

    Description: Determines if any descendant in this container widget is updated.

-   <a id="dlentry_container_getChildId"></a><b>get(String childId)</b>

    Return type: `Widget`

    Description: Returns the child widget with the specified tag `id` inside this container. The `get(childId)` method enables you to directly access the children of the `section` widget.

    Different ways to call the `get(childId)` method:

    -   <i>container</i>.<i>childId</i>

        Example

        ```
        mySection.textField.value = self.value;
        ```

    -   <i>container</i>['<i>childId</i> ']

        Example

        ```
        mySection['textField'].value = self.value;
        ```

    -   <i>container</i>.get('<i>childId</i> ')

        Example

        ```
        mySection.get('textField').value = self.value;
        ```


-   <a id="dlentry_container_getChildren"></a><b>getChildren()</b>

    Return type: `List`

    Description: Returns all children of this container widget as a list.

-   <a id="dlentry_container_getChildrenMap"></a><b>getChildrenMap()</b>

    Return type: `Map`

    Description: Returns a map containing all children of this container widget. The keys in the map are the ids of the children tags.

-   <b>isVisible()</b>

    Return type: `boolean`

    Description: Returns true if this widget is visible.

-   <b>setVisible(boolean visible)</b>

    Return type: `void`

    Description: Displays or hides this widget.

    If you need to change the visibility of a `section`, ensure that it's inside a `fieldSet`.



<b>fieldSet Methods</b>

-   <b>anyUpdated()</b>

    Return type: `boolean`

    Description: Determines if any descendant in this container widget is updated.

-   <a id="dlentry_1"></a><b>get(String childId)</b>

    Return type: `Widget`

    Description: Returns the child widget with the specified tag `id` inside this container. The `get(childId)` method enables you to directly access the children of the `fieldSet` widget.

    Different ways to call the `get(childId)` method:

    -   <i>container</i>.<i>childId</i>

        Example

        ```
        myFieldSet.textField.value = self.value;
        ```

    -   <i>container</i>['<i>childId</i> ']

        Example

        ```
        myFieldSet['textField'].value = self.value;
        ```

    -   <i>container</i>.get('<i>childId</i> ')

        Example

        ```
        myFieldSet.get('textField').value = self.value;
        ```


-   <a id="dlentry_2"></a><b>getChildren()</b>

    Return type: `List`

    Description: Returns all children of this container widget as a list.

-   <a id="dlentry_3"></a><b>getChildrenMap()</b>

    Return type: `Map`

    Description: Returns a map containing all children of this container widget. The keys in the map are the ids of the children tags.

-   <b>getTitle()</b>

    Return type: `string`

    Description: Returns the title of the `fieldSet`.

-   <b>isVisible()</b>

    Return type: `boolean`

    Description: Returns true if this widget is visible.

-   <b>setTitle(String title)</b>

    Return type: `void`

    Description: Sets the title of the `fieldSet`.

-   <b>setVisible(boolean visible)</b>

    Return type: `void`

    Description: Displays or hides this widget.



<b>dynamicSection Methods</b>

-   <a id="dlentry_4"></a><b>get(String childId)</b>

    Return type: `Widget`

    Description: Returns the child widget with the specified tag `id` inside this container. The `get(childId)` method enables you to directly access the children of the `dynamicSection` widget.

    Different ways to call the `get(childId)` method:

    -   <i>container</i>.<i>childId</i>

        Example

        ```
        mydynamicSection.textField.value = self.value;
        ```

    -   <i>container</i>['<i>childId</i> ']

        Example

        ```
        mydynamicSection['textField'].value = self.value;
        ```

    -   <i>container</i>.get('<i>childId</i> ')

        Example

        ```
        mydynamicSection.get('textField').value = self.value;
        ```


-   <a id="dlentry_6"></a><b>getChildrenMap()</b>

    Return type: `Map`

    Description: Returns a map containing all children of this container widget. The keys in the map are the ids of the children tags.

-   <b>setData(newDataObject)</b>

    Return type: None

    Description: Updates the data used by the child tags in this container widget. Use `setData(newDataObject)` during user interaction with the page after it loads. Example:

    ```
    "onChange" : "<% myDynamicSection.setData(self.value) %>"
    ```

    In this example, `myDynamicSection.setData(self.value)` is equivalent to `myDynamicSection.data = self.value`.



.

## <a id="section_editButtonMethods"></a>Edit Button Methods

Use these methods on an `editButton`.

-   <b>getValue()</b>

    Return type: `boolean`

    Description: Returns true when the user clicked the current `editButton`.

    <b>Note:</b> You can only reference the `value` property of `editButton` with PMD Scripting during page submission. You can't reference the `value` property as a tag attribute during page load.

-   <b>setValue(boolean value)</b>

    Return type: `void`

    Description: Sets the value of this widget. This method enables you to reset the `editButton` value, which indicates whether or not the user clicked the button.

    <b>Note:</b> You can only reference the `value` property of `editButton` with PMD Scripting during page submission. You can't reference the `value` property as a tag attribute during page load.



.

## <a id="section_endpointMethods"></a>Endpoint Methods

You can call the `invoke` method on a deferred endpoint to fetch data from a REST endpoint.

-   <b>invoke()</b>

    Return type: `Object`

    Description: Invokes an inbound endpoint without parameters, and returns the endpoint response. To reference the JSON fields in the returned object, save the returned object in a variable. For an example, see `invoke(Map arguments)`.

-   <b>invoke(Map arguments)</b>

    Return type: `Object`

    Description: Invokes an inbound endpoint with named parameters, and returns the endpoint response. To reference the JSON fields in the returned object, save the returned object in a variable.

    This sample script invokes the <i>getWorkerById</i> endpoint with the <i>id</i> parameter, and saves the returned object in <i>workerData</i>. It then uses the <i>workerData.person.email</i> field to populate the <i>workerEmailAddress</i> widget:

    ```
    
    // Invoke endpoint and pass id as a URL parameter
           var populateEmail = function(selectedWorkerId) {
               if( !(empty selectedWorkerId)) {
                   var workerData = getWorkerById.invoke({'id': selectedWorkerId});
                   workerEmailAddress.value = workerData.person.email;
               }
           };
    ```

    The sample <i>getWorkerById</i> endpoint with the <i>id</i> path parameter:

    ```
    {
       "name": "getWorkerById",
       "baseUrlType": "workday-staffing",
       "url": "<% '/workers/' + id %>",
       "authType": "sso",
       "deferred": true,
       "responseErrorDetail": {
         "errorSummary": "<% [error].addAll(errors.map(e => {e.error})).join('\\n') %>"
       }
    }
    ```

    This sample JSON shows the content of the <i>workerData</i> variable, which is the response data from the <i>getWorkerById</i> endpoint.

    ```
    {
      "descriptor": "Logan McNeil",
      "id": "3aa5550b7fe348b98d7b5741afc65534",
      "person": {
        "email": "lmcneil@workday.net",
        "id": "9feb1da3167840a9852698a2f228f795",
        "phone": "+1415789-8904"
      },
      ...
    }
    ```



.

## <a id="section_fileUploaderMethods"></a>File Uploader Methods

Use these methods on a `fileUploader`.

-   <b>clearError()</b>

    Return type: `void`

    Description: Clears the validation error.

-   <b>clearWarning()</b>

    Return type: `void`

    Description: Clears the validation warning.

-   <b>isRequired()</b>

    Return type: `boolean`

    Description: Returns true if this `fileUploader` requires at least 1 uploaded file.

-   <b>isVisible()</b>

    Return type: `boolean`

    Description: If true, this `fileUploader` is visible.

-   <b>getChildren()</b>

    Return type: `List`

    Description: Returns a list of `fileUploaderRow` widgets that have file content cached on the server. If `fileUploader` contains other widgets such as `hidden`, `getChildren` also returns those children widgets.

    If you want to get all rows that the user can see on the `fileUploader` widget, use the `getRows` method instead.

    <b>Note:</b> The page load caches the file content of a `fileUploadedRow` if it uses the `fileSource` attribute.

-   <b>getRows()</b>

    Return type: `List`

    Description: Returns a list of all `fileUploaderRow` widgets, with or without cached file content. The `getRows` method returns all rows that the user can see on the `fileUploader` widget.

-   <b>setError(String error)</b>

    Return type: `void`

    Description: Sets the validation error. The input error message displays in the page error window.

-   <b>setRequired(boolean required)</b>

    Return type: `void`

    Description: Makes at least 1 file required or not required on this `fileUploader`.

-   <b>setVisible(boolean visible)</b>

    Return type: `void`

    Description: Displays or hides this `fileUploader`.

    If you need to change the visibility of a `fileUploader`, ensure that it's inside a `fieldSet`.

-   <b>setWarning(String warning)</b>

    Return type: `void`

    Description: Sets the validation warning.



.

## <a id="section_fileUploaderRowMethods"></a>File Uploader Row Methods

Use these methods on a `fileUploaderRow`.

-   <b>getContentArea(int index)</b>

    Return type: `List`

    Description: Returns a list of widgets that represent custom information about the file on the row. Specify the index of the tag based on its position in the `contentArea[]` of the `fileUploaderRow`. You can use this method (or the equivalent `contentArea` property) to:

    -   Get or dynamically update the widgets in the `contentArea` of an existing `fileUploaderRow` instance.
    -   Dynamically update the widgets in the `contentArea` of a new row using the `fileUploaderRowTemplate` attribute of `fileUploader`.

    <b>Note:</b> The `contentArea` attribute of `fileUploaderRow` contains tags that render custom information. The `getContentArea(index)` method doesn't apply to the `fileName` attribute of `fileUploaderRow`.

    In this sample `fileUploader`, the `contentArea` of an existing row contains a text tag that displays file information. The `onChange` event on a separate text tag updates the file information in the `contentArea`.

    ```
    
    {
     "type": "fileUploader",
     "id": "myFileUploader1",
     "label": "My FileUploader with an Attachment",
     "fileTypes": "*",
     "children": [
       {
       "type": "fileUploaderRow",
       "allowRemove": false,
       "attachment": {
           "type": "attachmentList",
           "instanceList": [
           {
               "descriptor": "abc.txt",
               "action": "attachment",
               "mimeType": "text/plain"
           }
           ],
           "attachmentUriTemplate": "[Target]",
           "attachmentURL": "http://www.workday.com",
           "attachmentName": "abc.txt",
           "attachmentAuth": "sso"
       },
       "fileName": "abc.txt",
       "fileType": "text/plain",
       "contentArea": [
           {
           "type": "text",
           "id": "fileInfo",
           "label": "File comment"
           }
       ]
       }
     ]
    },
    {
     "type": "text",
     "id": "fileInfoUpdate",
     "onChange": "<% myFileUploader1.rows[0].contentArea[0].value = self.value; %>"
    }
    ```

    In the above example, when a user enters information in the <i>fileInfoUpdate</i> text widget, its `onChange` event handler calls `getContentArea` on the first row, gets the `contentArea` of the first widget, and updates its value with the user input.

    In this next example, the `fileUploaderRowTemplate` creates the `contentArea` of a new row on the fileUploader. The `onChange` event on a text widget in the `contentArea` dynamically sets the value of another text widget:

    ```
    {
     "type": "fileUploader",
     "id": "myFileUploader2",
     "label": "My FileUploader 2",
     "fileTypes": "*",
     "fileUploaderRowTemplate": [
       {
         "type": "text",
         "label": "Comments",
         "id": "comments1",
         "onChange": "<% comments2.value = self.value; %>",
         "required": true
       },
       {
         "type": "text",
         "label": "More comments",
         "id": "comments2",
         "required": true
       }
     ]
    }
    ```

-   <b>getFileName()</b>

    Return type: `string`

    Description: Returns the name of the file on the `fileUploaderRow`.



.

## <a id="section_gridWidgetMethods"></a>Grid Widget Methods

Use these methods on instances of a `grid` container.

-   <b>addRow(int index)</b>

    Return type: `void`

    Description: Adds a row at the specified index position. The index must be between 0 and the `grid` size.

-   <b>anyUpdated()</b>

    Return type: `boolean`

    Description: If true, any descendant in this container widget is updated.

-   <b>getChildren()</b>

    Return type: `List`

    Description: Returns a list containing all children of this container widget.

-   <b>getDoNotAdd()</b>

    Return type: `boolean`

    Description: If true, this grid doesn't allow the grid user to add rows.

-   <b>getDoNotRemove()</b>

    Return type: `boolean`

    Description: If true, this grid doesn't allow the grid user to remove rows.

-   <b>getLabel()</b>

    Return type: `string`

    Description: Returns the grid label.

-   <b>getRows()</b>

    Return type: `List`

    Description: Returns all rows of this grid as a list of grid row objects. Same as getChildren().

-   <b>getSelectedRows()</b>

    Return type: `List`

    Description: Returns all selected rows of this grid as a list of grid row objects.

-   <b>getSubtotal(String columnId)</b>

    Return type: `BigDecimal`

    Description: Returns the subtotal of the specified column.

-   <b>isVisible()</b>

    Return type: `boolean`

    Description: If true, this widget is visible.

-   <b>removeRow(int index)</b>

    Return type: `void`

    Description: Removes the row at the specified index position. The index must be between 0 and the `grid` size.

-   <b>setDoNotAdd(boolean doNotAdd)</b>

    Return type: `void`

    Description: Enables or disables the ability to add rows to the grid.

-   <b>setDoNotRemove(boolean doNotRemove)</b>

    Return type: `void`

    Description: Enables or disables the ability to remove rows from the grid.

-   <b>setLabel(String label)</b>

    Return type: `void`

    Description: Sets the grid label.

-   <b>setRows(List newValue)</b>

    Return type: `void`

    Description: Sets the new data source to refresh the grid.

-   <b>setVisible(boolean visible)</b>

    Return type: `void`

    Description: Display or hides this widget. Ensure that this widget is inside a `fieldSet`.

    If you need to change the visibility of a `grid`, ensure that it's inside a `fieldSet`.



.

## <a id="section_gridRowWidgetMethods"></a>Grid Row Widget Methods

Use these methods on grid row instances.

-   <b>anyUpdated()</b>

    Return type: `boolean`

    Description: If true, any descendant in this container widget is updated.

-   <b>get(String childId)</b>

    Return type: `Widget`

    Description: Returns the child widget with the specified tag `id` on this grid row. For the <i>childId</i> input argument:

    -   If the column `cellTemplate` has only 1 tag, specify the `id` of the `column`.
    -   If the column `cellTemplate` has a container widget such as a `section` or `fIeldSet`, specify the path to the `id` of the appropriate child tag.

    Instead of using the `childrenMap` property of a grid row or cell, use the `get(childId)` method to access the children widgets directly. Example:

    ```
    // Assume row is a grid row instance, and the grid has column1 and column2.
    // column2 contains innserSection with a numberCell.
    // Direct access to the numberCell value:
    row.column1.value + (row.column2.innerSection.numberCell.value ?? '');
    // Equivalent call using childrenMap:
    row.childrenMap.column1.value + (row.childrenMap.column2.childrenMap.innerSection.childrenMap.numberCell.value ?? '')
    ```

    Different ways to call the `get(childId)` method:

    -   <i>gridRow</i>.<i>childId</i>

        Example:

        ```
        self.value = dataGrid.rows.map(row => {
         row.column1.value + (row.column2.column2Section.textCell.value ?? '')
        }).join(',');
        ```

    -   <i>gridRow</i>['<i>childId</i> ']

        Example:

        ```
        self.value = dataGrid.rows.map(row => {
         row['column1'].value + (row['column2']['column2Section']['numberCell'].value ?? '')
        }).join(',');
        ```

    -   <i>gridRow</i>.get('<i>childId</i> ')

        Example:

        ```
        self.value = dataGrid.rows.map(row => {
         row.get('column1').value + (row.get('column2').get('column2Section').get('textCell').value ?? '')
        }).join(',');
        ```


-   <b>getChildren()</b>

    Return type: `List`

    Description: Returns a list containing all children of this container widget.

-   <b>getChildrenMap()</b>

    Return type: `Map`

    Description: Returns a map containing all children of this grid row. To identify each cell on the grid row, the map uses the `columnId` attribute of the grid `column`.

-   <b>isSelected()</b>

    Return type: `boolean`

    Description: If true, this grid row is selected.



.

## <a id="section_imageWidgetMethods"></a>Image Widget Methods

Use these methods on an `image`.

-   <b>getImageUri()</b>

    Return type: `string`

    Description: Returns the URI location of the image.

    Use `getImageUri` on an `image` tag that uses the `imageUri` attribute. You can't call `getImageUri` if the `image` tag uses the `endPoint` attribute.

-   <b>setEndPointUrl(string)</b>

    Return type: `void`

    Description: Sets the `url` of the endpoint that displays the image. You can only set the `url` attribute of the endpoint. An updated `url` uses the existing `baseUrl` and `authType` attributes of the endpoint.

    Use `setEndPointUrl` on an `image` tag that uses the `endPoint` attribute. Note that if you use both the `endPoint` and `imageUri` attributes on the `image` tag, `setEndPointUrl` ignores `imageUri`.

-   <b>setImageUri(string)</b>

    Return type: `void`

    Description: Sets the URI location of the image.

    You can't call `setImageUri` if the `image` tag uses the `endPoint` attribute.

    Use `setImageUri` on an `image` tag that uses the `imageUri` attribute. You can't call `setImageUri` if the `image` tag uses the `endPoint` attribute.



.

## <a id="section_instanceListWidgetMethods"></a>Instance List Widget Methods

Use these methods on instances of these list widgets:

-   `instanceList`
-   `checkBoxList`
-   `dropdown`
-   `radioGroup`


-   <b>clearError()</b>

    Return type: `void`

    Description: Clears the validation error.

-   <b>clearWarning()</b>

    Return type: `void`

    Description: Clears the validation warning.

-   <b>getLabel()</b>

    Return type: `string`

    Description: Returns the list label.

-   <b>getPromptSelections(int index)</b>

    Return type: `List`

    Returns a list containing the `id` of the selected values of a multilevel `instanceList`. Example: `promptSelections[0]` contains the `id` of the selected value at the root level. `promptSelections[1]` contains the `id` of the selected value at the second level, and so on.

    <b>Note:</b> The `getPromptSelections(index)` method (or its equivalent `promptSelections` property) applies only to a multilevel `instanceList` that contains `monikerLevels`. You can use promptSelections as a URL path parameter of a deferred endpoint that returns the sublevel values. See "Defining a Multilevel List" in [instanceList](/wcp_docs/hcb1512514976081.html).

-   <b>getSelectedEntries()</b>

    Return type: `List`

    Description: Returns a list of maps containing the `id` and `descriptor` fields for the selected entries on the instance list.

    Example: `[{"id": "123", "descriptor": "Logan McNeil"}]`

    If the list doesn't have a selected value, the `getSelectedEntries` method (or its equivalent `selectedEntries` property) returns an empty list, `[]`. When you get the `descriptor` value of the selected entry, always check whether or not the list value is empty. Example:

    ```
    <% !empty someList.value ? someList.selectedEntries[0].descriptor : null %>
    ```

-   <b>getValue()</b>

    Return type: `List`

    Description: Returns this instance list as a list of instance ids. Example: `["123", "456"]`

    If the list is empty, the `getValue` method (or its equivalent `value` property) returns an empty list, `[]`.

-   <b>getValueOutBinding()</b>

    Return type: `string`

    Description: Returns the outbound value binding of this instance list.

-   <b>isEnabled()</b>

    Return type: `boolean`

    Description: If true, this widget is enabled.

-   <b>isRequired()</b>

    Return type: `boolean`

    Description: If true, this widget is required.

-   <b>isUpdated()</b>

    Return type: `boolean`

    Description: If true, this widget is manually updated by the end-user.

-   <b>isUpdatedByScript()</b>

    Return type: `boolean`

    Description: If true, this widget is programmatically updated by a PMD script.

-   <b>isVisible()</b>

    Return type: `boolean`

    Description: If true, this widget is visible.

-   <b>setEnabled(boolean enabled)</b>

    Return type: `void`

    Description: Enables or disables this widget.

-   <b>setError(String error)</b>

    Return type: `void`

    Description: Sets the validation error. The input error message displays in the page error window.

-   <b>setLabel(String label)</b>

    Return type: `void`

    Description: Sets the list label.

-   <b>setRequired(boolean required)</b>

    Return type: `void`

    Description: Makes this widget required or not required.

-   <b>setValue(List value)</b>

    Return type: `void`

    Description: Sets this instance list to the specified list of instance `id` values. You can use `someList.setValue(['id1', 'id2'])` to set the `selectedValues` property of an `instanceList`.

-   <b>setValueOutBinding(String valueOutBinding)</b>

    Return type: `void`

    Description: Sets the outbound value binding to this instance list.

-   <b>setValues(List dataSource)</b>

    Return type: `void`

    Description: Sets all possible values of this instance list. The dataSource list must include the `id` and `descriptor` fields (or the fields specified by the `idKey` and `displayKey` attributes).

-   <b>setVisible(boolean visible)</b>

    Return type: `void`

    Description: Displays or hides this widget.

    If you need to change the visibility of a list widget, ensure that it's inside a `fieldSet`.

-   <b>setWarning(String warning)</b>

    Return type: `void`

    Description: Sets the validation warning.



.

## <a id="section_panelListWidgetMethods"></a>Panel List Widget Methods

Use these methods on instances of a `panelList`.

-   <b>addPanel(int index)</b>

    Return type: `void`

    Description: Adds a panel at the specified index position. The index must be between 0 and the `panelList` size. The `addPanel` method ignores the `doNotAdd` attribute on the `panelList`.

-   <b>anyUpdated()</b>

    Return type: `boolean`

    Description: If true, any descendant in this container widget is updated.

-   <b>getChildren()</b>

    Return type: `List`

    Description: Returns a list containing all children of this container widget.

-   <b>getDoNotAdd()</b>

    Return type: `boolean`

    Description: If true, a user can't add a panel to the `panelList`.

-   <b>getDoNotRemove()</b>

    Return type: `boolean`

    Description: If true, a user can't remove a panel from the `panelList`.

-   <b>getPanels()</b>

    Return type: `List`

    Description: Returns all panels of this panel list as a list of panel objects. Same as getChildren().

-   <b>isVisible()</b>

    Return type: `boolean`

    Description: If true, this widget is visible.

-   <b>removePanel(int index)</b>

    Return type: `void`

    Description: Removes a panel at the specified index position. The index must be between 0 and the `panelList` size. The `removePanel` method ignores the `doNotRemove` attribute on the `panelList`.

-   <b>setDoNotAdd(boolean doNotAdd)</b>

    Return type: `boolean`

    Description: If true, a user can't add a panel to the `panelList`.

-   <b>setVisible(boolean visible)</b>

    Return type: `void`

    Description: Enables or disables the ability to add panels to the `panelList`.

    If you need to change the visibility of a `panelList`, ensure that it's inside a `fieldSet`.



.

## <a id="section_panelWidgetMethods"></a>Panel Widget Methods

Use these methods on panel instances in a `panelList`.

-   <b>anyUpdated()</b>

    Return type: `boolean`

    Description: If true, any descendant in this container widget is updated.

-   <b>getChildren()</b>

    Return type: `List`

    Description: Returns a list containing all children of this container widget.

-   <b>isVisible()</b>

    Return type: `boolean`

    Description: If true, this widget is visible.

-   <b>setVisible(boolean visible)</b>

    Return type: `void`

    Description: Displays or hides this widget.

    If you need to change the visibility of a widget, ensure that it's inside a `fieldSet`.



.

### Related Information

[Concept: PMD Scripting](/wcp_docs/oli1581402304020.html)

[Reference: PMD Scripting Syntax](/wcp_docs/snh1581402351791.html)

[PMD Scripting](/wcp_docs/jab1582081565510.html)

[Reference: PMD Scripting Examples](/wcp_docs/mdp1582058758619.html)

[App Catalog: PMD Scripting](/app-catalog/pmdScripting)

