Show TOC

Adding Actions to the Action ButtonLocate this document in the navigation structure

Use

The mobile framework pages come with an action button Action that enables you to perform various actions, such as refresh, add to favorites, and log off.

On the Smartphone Framework Page , the action button opens a horizontal toolbar that contains the available actions.

On the Tablet Framework Page , the action button opens a vertical menu that displays the available actions.

You can configure different application-specific sets of actions, using the createCollection and createItem methods in the Collections client-side APIs for the Ajax Framework Page (AFP), and the collection type ACTION_BAR_ITEM .

Procedure
  1. Create a collection of type ACTION_BAR_ITEM , to contain the actions.

  2. Create a collection item for each action.

  3. Specify an icon for the action. Otherwise, a default icon is used.

Sample Code
               //Create a collection to contain the action
EPCM.getSAPTop().LSAPI.Collections.createCollection(
                        "collectionID",
                        EPCM.getSAPTop().LSAPI.Collections.Types.ACTION_BAR_ITEM,
                        "collectionTitle",
                        "collectionTooltip",
                        null,
                        null,
                        true,
                        10,
                        false); 
//Create a collection item to define the action
EPCM.getSAPTop().LSAPI.Collections.createItem(
                        "collectionID", //parent collection ID
                        "itemID", 
                        "My Action", 
                        "actionTooltip", 
                        function(){
                          alert("Action was chosen");
                        },
                        null, 
                        true, 
                        20, 
                        null, 
                        null, 
                        true, 
                        false,
                        "/images/actionBar/action_icon.png"); //action icon

            
Note

To add more than one action, create several collection items within a single collection.

More Information

For information about configuring the out-of-the-box action button and its actions, see Configuring Properties of Mobile Framework Pages .

For more information about the Collections API, see Collections API .