# WRTKit NavigationButton Class

## Description

The NavigationButton class implements a control that is intended for use in navigation menu -style user interfaces. A navigation button is typically used to let users move between views.

Figure 1. NavigationButton controls

## Inherits from

ActionControl

Parent topic: WRTKit API Reference

## Constructor

### Syntax

    [NavigationButton] new NavigationButton(String id, String image, String text)

### Description

Creates a new instance of the NavigationButton class.

### Arguments

- id

  Unique identifier for the control. Can be retrieved using the id property defined in the UIElement class that this control inherits from. Useful for example to identify the source of an event in event callback functions or to apply a CSS rule to only this particular control. The identifier can be null, in which case no id will be set for the control.

- image

  Icon image that is displayed on the face of the button. No size is enforced but the image should be about 30x30 pixels. PNG images with transparency are recommended. If null is passed for the image then no image will be displayed.

- text

  Text that is displayed on the face of the button. Typically this should be the view that the widget navigates to when the button is pressed. The value is an XHTML string.

### Return value

A new instance of the NavigationButton class.

## getText()

### Syntax

    [String] NavigationButton.getText(void)

### Description

Retrieves the current text of the button. The value is an XHTML string.

### Arguments

This method does not take any arguments.

### Return value

The current text of the button.

## setText()

### Syntax

    [void] NavigationButton.setText(String text)

### Description

Sets the text of the button. The text is displayed on the face of the button and typically should indicate where the widget navigates when the button is pressed. The value is an XHTML string.

### Arguments

- text

  The text to be displayed on the face of the button. Passing null results in no text.

### Return value

This method does not return a value.

## getImage()

### Syntax

    [String] NavigationButton.getImage(void)

### Description

Retrieves the icon image URL of the button.

### Arguments

This method does not take any arguments.

### Return value

The icon image URL of the button or null if none.

## setImage()

### Syntax

    [void] NavigationButton.setImage(String image)

### Description

Sets the icon image URL for the button. Passing null to this method hides the icon image.

### Arguments

- image

  The URL of the icon image to display on the button or null for no image.

### Return value

This method does not return a value.