setRightSoftkeyLabel()

Description:

Call the setRightSoftkeyLabel method to customize the label and the operation associated with the right softkey.

By default, the right softkey of a device is assigned to the "Exit" function, which terminates a running widget. The default label depends on the current used system language (Exit for English).

For more general information on using softkeys in your widget, see Using softkeys.

Syntax:

[void] window.menu.setRightSoftkeyLabel(String label, Function callbackfunc) 

or

[void] menu.setRightSoftkeyLabel(String label, Function callbackfunc)

Arguments:

  • label:

    A text string specifies the label to be shown on the right softkey.

  • callbackfunc:

    A reference to the callback function, which will be called by the system when the right softkey is pressed.

Return value:

This method does not return a value.

Remarks:

The default label and "Exit" function of the right softkey can be restored by calling the setRightSoftkeyLabel with an empty string ('') specified for the label argument and the callbackfunc argument set to null.

Example code:

function switchToSettingsView()
{
 // implement and show settings
 ...
 // customize the right softkey
 window.menu.setRightSoftkeyLabel('Back', returnToMainView);
}
function returnToMainView()
{
  // show main view
 ...
 // restore the default right softkey
 window.menu.setRightSoftkeyLabel('', null);
}