---
title: "action"
description: "Handle selection of an object-list item."
permalink: /docs/runtime/all-ui-components/object-list/action/
---
# action

## Overview

To make an `object-list` [clickable](/docs/runtime/all-ui-components/object-list/#clickable-object-list), an `action` tag should be added to the `object-list.`

### Basic Example

**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>
```

## Standard Attributes

### `validate`

<SyntaxCard type={"boolean"} defaultValue={"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`

<SyntaxCard type={"string"} defaultValue={"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](/docs/runtime/all-ui-components/icons/#font-awesome-library) or an [Ionicons icon](/docs/runtime/all-ui-components/icons/#ionicons-library).

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

## Common Attributes

### `on-press`

<AttributeReference label="on-press" href="/docs/runtime/common-component-attributes/on-press/" />
