Toolbar Class Reference

This class allows to set the toolbar title, add action buttons and manage tabs. All methods in this class are static.

Toolbar.setTitle(title) Toolbar.addButton(label, onclick, style) Toolbar.addTab(label, onclick) Toolbar.setStyle(style) Toolbar.setColor(color)

Toolbar.setTitle(title)

set the toolbar title with the title (string) parameter

Toolbar.setTitle("Edit Task");

Toolbar.addButton(label, onclick, style)

Adds a button in the toolbar.

The optional style parameter is used on native apps to use platform specific icons for these predefined actions

Toolbar.addButton("New", "newTaskActivityPopup({id})", "new");
Toolbar.addButton("Edit", "editTask({id})", "edit");
Toolbar.addButton("Export PDF", "exportTask({id})");

Toolbar.addTab(label, onclick)

Adds a tab to the current screen. label (string) is the tab label. onclick (string) is the callback function to execure when the tab is pressed.

Toolbar.addTab("List", "viewList()");
Toolbsar.addTab("Map", "viewMap()");

Toolbar.setStyle(style)

Set a special style for the toolbar. Supported styles are:
nextprevious and search are supported on native app only and ignored for web

Toolbar.setColor(color)

set the toolbar color on mobile phones and tablets.

Toolbar.setColor(Color.ORANGE);