> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# ISingleSelectionHandler

- Package: [@gooddata/sdk-ui-filters](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/index.md)
- Kind: interface
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-ui-filters/src/AttributeFilterHandler/types/selectionHandler.ts

Handles simple selection of at most one item.

**Signature:**

```typescript
export interface ISingleSelectionHandler<T> 
```

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [onSelectionChanged](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.isingleselectionhandler/index.md#isingleselectionhandleronselectionchanged) |  | [CallbackRegistration](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.callbackregistration/index.md)&lt;[OnSelectionChangedCallbackPayload](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.onselectionchangedcallbackpayload/index.md)&lt;T&gt;&gt; | Registers a callback that will be fired when the selection changes. Returns unsubscribe function, that will unregister it, once called. Multiple callbacks can be registered by this function. |

## Methods

| Method | Description |
| --- | --- |
| [changeSelection(selection)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.isingleselectionhandler/index.md#isingleselectionhandlerchangeselection) | Change the selection. |
| [getSelection()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.isingleselectionhandler/index.md#isingleselectionhandlergetselection) | Returns the current selection. |

## Property details

### ISingleSelectionHandler.onSelectionChanged

Registers a callback that will be fired when the selection changes. Returns unsubscribe function, that will unregister it, once called.

Multiple callbacks can be registered by this function.

**Signature:**

```typescript
onSelectionChanged: CallbackRegistration<OnSelectionChangedCallbackPayload<T>>;
```

## Method details

### ISingleSelectionHandler.changeSelection()

Change the selection.

**Signature:**

```typescript
changeSelection(selection: T): void;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| selection | T | new selection |

**Returns:**

void

### ISingleSelectionHandler.getSelection()

Returns the current selection.

**Signature:**

```typescript
getSelection(): T;
```
**Returns:**

T
