Share via


Simple List action area and action items

The action area in a Simple List displays action buttons. The Simple List uses the ActionButton.htc and ActionButtons.htc components to create and display an action area with action buttons. To display an action area in the result viewer, the HasActionButtons property must be set to true.

HasActionButtons="true"

To display action buttons in an action area, set up a function that creates the action buttons and call this function when the result viewer’s OnReady event occurs. The following code shows how to define an action button. This function is written in JavaScript and should be added to the code that is used to create the page displaying the Simple List.

function OnSimpleList1Ready()
{
    //Add a stylesheet.
    SimpleList1.AddStyleSheet("/BusinessPortal/UI/ResultViewer/Stylesheets/SimpleList.css");

    //Define an action button.
    var button=SimpleList1.ActionButtons.AddButton();
    button.ButtonValue="Add New Item";
    button.ButtonTitle="Add a new item to the list.";
    button.OnAction=AddInventoryItem;
}

The display name for an action button is specified by the ButtonValue property. When the mouse pointer pauses on an action button, the text given for the ButtonTitle property will be displayed as a tooltip. Each action button has an OnAction event that occurs when you click the action button. In this example, AddInventoryItem() is a function written in JavaScript that is called when the action button’s OnAction event occurs. The details for implementing this function are not provided here.

Be sure the function that creates the action buttons is called when the result viewer’s OnReady event occurs.

OnReady="OnSimpleList1Ready()"