HP Anywhere 10.11 API Reference
Show:

HPA.ActionsBar

Module: HPA

Available since HP Anywhere 10.01

[Smartphone Edition]

Customize the Action bar in an app.

Use this API to dynamically:

  • add an Action button
  • show/hide the Action bar
  • override the existing set of buttons
  • add additional options to the More menu

In the smartphone edition, the actions bar is displayed on the bottom left corner, changing its buttons according as the user navigates in the application. App developers can customize it to their needs, as described above. By default, in the experience view, it appears this way:

Methods

setActions

(
  • items
)
supports offline

Available since HP Anywhere 10.01

Add customized items to the Action bar, such as a list of menu options or a single button. When the user taps a button or a command, the app's openEntryPoint method is called, and the data defined in the action is passed as parameters. There are three kinds of actions, each requires an additional property:

  • defaultAction - requires an icon which will be placed in the actions bar.
  • barAction - requires either an icon or text which will be placed in the actions bar.
  • moreAction - requires a text which will be placed in the 'more' menu.
Usage example: HPA.ActionsBar.setActions([ { icon: 'Add', action: "defaultAction", params: "add"}, { text: "About", action: "moreAction", params: "Create, edit and view events" }, { text: "Do something", action: "moreAction", params: "Did something..." } ]); HPA.ActionsBar.setActions([ { text: "Share", action: "barAction", params: "share" } ]);

Parameters:

  • items Array

    Items to be placed in the actions bar. Every item is an object with the following properties:

    • action String

      Type of action, either 'barAction', 'defaultAction' or 'moreAction'. This will be provided as the 'entryPoint' parameter to the app's openEntryPoint function.

    • [params] String optional

      Additional parameters which will be provided as the 'params.params' parameter to the app's openEntryPoint function.

    • icon String

      Required for defaultAction; this or 'text' required for barAction. Must be one of the following: Add, Attach, Delete, Edit, Photo, Remove, Save, Search, Store. A suitable icon will be displayed in the bar. This will be provided as the 'params.iconCls' parameter to the app's openEntryPoint function.

    • text String

      Required for 'moreAction'; this or 'icon' required for barAction. The string to display in the bar or the 'More' menu. If the item is a 'barAction', the text should be very short, typically one word. This text will be provided as the 'params.text' parameter to the app's openEntryPoint function.

setVisible

(
  • visible
)
supports offline

Available since HP Anywhere 10.01

Hide/show the Action bar.

Parameters:

  • visible Boolean

    True/False Usage example: HPA.ActionsBar.setVisible(false);