# action

## Overview

To make an `object-list` [clickable](https://docs.journeyapps.com/reference/build/ui-components/all-ui-components/object-list/..#clickable-object-list), an `action` tag should be added to the `object-list.`

### Basic Example

{% code title="main.view\.xml" %}

```xml
<var name="all_items" type="query:item" />

<object-list query="all_items" label="All Items:" empty-message="There are no items">
    <action on-press="$:selectItem($selection)" />
</object-list>
```

{% endcode %}

## Standard Attributes

### `on-press`

{% content-ref url="../../xml-fields/on-press" %}
[on-press](https://docs.journeyapps.com/reference/build/ui-components/xml-fields/on-press)
{% endcontent-ref %}

### `validate`

**Optional**

**Type**: `boolean`

**Default**: `false`

Set to `true` to ensure that no required input fields in the current view are empty before performing the [`on-press`](#on-press) action.

```xml
<action on-press="$:selectItem($selection)" validate="true" />
```

## Advanced Attributes

### `icon`

**Optional**

**Type**: `string`

**Default**: `ion-chevron-right`

The icon to display on the button, it will be placed on the left of the label by default. The icon can be a [Font Awesome icon](https://docs.journeyapps.com/reference/build/ui-components/icons#font-awesome-icons) or an [Ionicons icon](https://docs.journeyapps.com/reference/build/ui-components/icons#ionicons-icons).

```xml
<action on-press="$:selectItem($selection)" icon="fa-arrow-right" />
```
