Overview
A ButtonBar Layout is a collection of ButtonBars arranged in a single view. Layouts can be created using the ButtonBar Tool, a desktop utility for Windows. This API module is used to show/hide specified layouts created through the tool.
IMPORTANT:
- This API works only with layouts created with the ButtonBar Tool.
- To control the size, position, actions and other button attributes, see the ButtonBar Usage guide.
Syntax
buttonBarLayout (Module) <META> Syntax |
---|
<META HTTP-Equiv="buttonBarLayout" content="[parameter]"> |
ButtonBarLayout JavaScript Object Syntax: |
---|
By default the JavaScript Object 'buttonBarLayout' will exist on the current page and can be used to interact directly with the buttonBarLayout. |
To Invoke buttonBarLayout methods via JavaScript use the following syntax: ButtonBarLayout.property;
e.g. buttonBarLayout.enabled= "LayoutName"; e.g. buttonBarLayout.disabled= "LayoutName"; |
Properties
Items listed in this section indicate methods or in some cases parameters that can be retrieved.Name | Description | Default Value |
---|---|---|
enabled | Show the Layout with this name | N/A |
disabled | Hide the layout with this name | N/A |
Parameters
Items listed in this section indicate parameters or attributes that can be set.Name | Possible Values | Description |
---|---|---|
enabled:[Value] | ‘Layoutname’ | Shows the layout with the specified name |
disabled:[Value] | ‘Layoutname’ | Shows the layout with the specified name |
Remarks
Screen Orientation
When the screen orientation changes, using either the ScreenOrientation tag or by rotating a device with hardware support, the buttons themselves do not move. In some cases, this results in layouts that appear partially off the screen or are not in the expected position. If so, Zebra recommends creating different layouts for portrait and landscape modes and switching to the appropriate layout by detecting the orientation with ScreenOrientationEvent.
Requirements
EnterpriseBrowser Version | 2.0 or later |
---|---|
Supported devices | All supported Android devices |
Minimum Requirements | None |
Persistence | Persistent - Changes to this module persist when navigating to a new page |
HTML/JavaScript Examples
The following example demonstrates how to show the Layouts created through the ButtonBar Layout tool by injecting metatags into a page.
<META HTTP-Equiv="buttonBarLayout" Content="Disabled:qwertylayout">
<META HTTP-Equiv="buttonBarLayout" Content="Enabled:qwertylayout">
Alternatively a particular Layout can be shown on all pages of the application using the DefaultMetaTags tag in the Config.xml
file without changing the server application code. Please include the following in the DefaultMetaTags section in the Config.xml
.
<DefaultMetaTags>
<MetaTag value=" buttonBarLayout~ enabled:numericlayout;"/>
<MetaTag value=" buttonBarLayout~ disabled:numericlayout;"/>
</DefaultMetaTags>
The following example demonstrates how to show/hide the ButtonBar via JavaScriptable objects.
<script>
function showbuttonbar()
{
buttonBarLayout.enabled= "LayoutName";
}
function hidebuttonbar()
{
buttonBarLayout.disabled= "LayoutName";
}
</script>