---
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, Presentation Components, widgets, tags, UI components]
nav: wcp_docs
parent_url: /wcp_docs/
title: editButton
layout: subsection
wd_wcptag: editButton
---

<a id="section_N10021_N1001E_N10001"></a>
Use `editButton` to customize button labels and button type on edit pages. These buttons can only occur within the `editButtonBar`.

Use `editButton` only on edit pages.

## <a id="section_tcq_yjc_ccb"></a>Example

```
{ 
  "type":"editButtonBar", 
  "editButtons": [ 
    { "type": "editButton", 
      "label": "button1", 
      "id": "1", 
      "buttonType": "PRIMARY", 
      "ignoreRequiredFields": "true" 
    }, 
    { "type": "editButton", 
      "label": "button2", 
      "id": "2", 
      "buttonType": "AUXILIARY" 
    } 
  ] 
}
```

## <a id="section_nk3_hdz_2qb"></a>Determining When a User Clicks the editButton

If your edit page contains multiple edit buttons, you can use the `value` property of `editButton` to determine which button the user clicked during page submission. Example: An `editButtonBar` contains both an `editButton` and a `dropdownEditButton` widget. In this case, the user can click an `editButton` to ignore required fields and navigate to another page. You can use flow variables to check the `editButton` value to determine which button the user clicked.

<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.

This sample `editButtonBar` contains an `editButton` that ignores required fields and enables a user to save a draft:

```
{
  "type": "editButtonBar",
  "id": "buttons",
  "editButtons": [
    {
      "type": "editButton",
      "id": "draft",
      "label": "Save as Draft",
      "buttonType": "PRIMARY",
      "ignoreRequiredFields": "true"
    },
    {
      "type": "dropdownEditButton",
      "label": "Choose a button",
      "buttonType": "AUXILIARY",
      "dropDown": {
        "id": "review",
        "type": "dropdown",
        "label": "Choose a button",
        "instanceList": [
          {
            "id": "1",
            "descriptor": "Confirm"
          },
          {
            "id": "2",
            "descriptor": "Review"
          }
        ]
      }
    }
  ]
}
```

These flow variables determine which button the user clicked during page submission:

```
"outboundEndPoints": [
  {
    "name": "transitionOutboundVars",
    "type": "outboundVariable",
    "variableScope": "flow",
    "values": [
      {
        "outboundPath": "draftClicked",
        "value": "<% draft.value %>"
      },
      {
        "outboundPath": "buttonValue",
        "value": "<% empty review.value[0]? '':review.value[0] %>"
      }
    ]
  }
]
```

In the page flow definition, use the flow variables to determine the transition condition for the next page. Example:

```
 {
   "id": "orderSubmitConcludeFlow",
   "flowSteps": [
     {
       "id": "start",
       "taskId": "editButtonTest",
       "startsFlow": true,
       "transitions": [
          {
            "order": "a",
            "value": "confirmStep",
            "condition": "<% !flowVariables.draftClicked && flowVariables.buttonValue == '1' %>"
          },
          {
        "order": "b",
        "value": "reviewPage",
        "condition": "<% !flowVariables.draftClicked && flowVariables.buttonValue == '2' %>"
          },
          {
            "order": "c",
            "value": "saveAsDraft",
            "condition": "<% flowVariables.draftClicked %>"
          }            
        ]
     },
     {
       "id": "confirmStep",
       "taskId": "confirmPage",
       "endsFlow": true
     },
     {
       "id": "reviewPage",
       "taskId": "reviewPage",
       "endsFlow": true
     },
     {
       "id": "saveAsDraft",
       "taskId": "saveAsDraftPage",
       "endsFlow": true
     }
   ]
 }
```

## <a id="section_lg4_v1g_khb"></a>Mobile Support

Android, iOS

## <a id="section_kt1_dkg_5cb"></a>Attributes

-   <b>buttonType</b>

    Data type: string

    The display style of the button. Valid values:

    -   `PRIMARY` - Displays a button with high emphasis. This display style is typically for designating the primary action that moves the user forward in a process.
    -   `AUXILIARY` - (Default) Displays a button with medium emphasis. This display style is typically for:

        -   Secondary actions on a screen.
        -   Canceling a process.
        -   Taking an action that moves the user away from a process.

    -   `LINK` - Displays a link. This display style is for a page navigation option. Not supported in the Workday mobile app.

-   <b>id</b>

    Data type: binding-String

    Unique identifier used to reference this widget from other tags.

    Notes:

    -   The `id` must start with a letter.
    -   The `id` must be unique per page.
    -   To enable other widgets to reference this widget `id`, place this widget before the other widgets on the PMD. The PMD validation returns an "Undefined variable" error if it doesn't find a previously defined `id` in the PMD.
    -   Workday recommends that you include the `id` in your tag definitions for debugging purposes.

-   <b>ignoreRequiredFields</b>

    Data type: binding-Boolean

    If true, we ignore whether or not required fields contain data when the user clicked the button.

-   <b>label</b>

    Data type: dynamicBinding-String

    The text that displays on the button.

-   <b>render</b>

    Data type: binding-Boolean

    If true, this tag renders as a widget on the page. If false, the loaded page doesn't add this tag or its children. The default is true.

    Unlike the `visible` attribute, when `render` is false, other tags on the page can't reference this tag or widget on edit pages. On view pages, a tag can't reference other tags regardless of the `render` attribute value.

-   <b>sortOrder</b>

    Data type: binding-String

    When you set `sorted` to true on the `section` or `fieldSet` parent of this widget, the `sortOrder` attribute determines the order of this widget within its parent. The sort order is relative to the siblings of the widget.

    Typical values are "a", "b", "c", and so on. Example: The widget with `"sortOrder": "a"` displays before the widget with `"sortOrder": "b"`.

    <b>Note:</b> The `sortOrder` doesn't apply to sorting data on the widget. `sortOrder` only applies to the placement order of the widgets within the parent widget.

-   <b>visible</b>

    Data type: dynamicBinding-Boolean

    If true, the widget generated by this tag is visible. If false, this tag and its children tags aren't visible. This tag provides the ability to display or hide the widget dynamically based on user interactions on the page. The default is true. Unlike the `render` attribute, the generated widget persists on the page even when `visible` is false.

    <b>Notes:</b>

    -   When the widget or field you’re hiding changes on the page, you must include it inside a `fieldSet`.
    -   When the `visible` attribute is false for this widget on an edit page, the outbound endpoint doesn't include the `valueOutBinding` or `valuesOut` data of the widget in the payload. To include the `valueOutBinding` or `valuesOut` data in the payload, use the `onSend` event handler.



## <a id="section_pmdScriptingMethods"></a>PMD Scripting Methods

-   <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.



