Working with ButtonsHolder
Introduction
ButtonsHolder is a set of buttons with commands and handlers, defined in a special XML section. ButtonsHolder can be described in the View/ListViewUI/ButtonSet section when you use it in a separate page, or in the View/Form/ButtonSets/ButtonSet section when you use it inside an XmlFormBuilder-like view.
Adding a button
In this example we add a button to ShipmentStatus. To do this, we have to put the file with the name "PurchaseOrder-ObjectView.OrderShipment.xml" into our ~/Apps/%AppName%/Config/View/ folder.
<?xml version="1.0" encoding="utf-8" ?>
<View xmlns="http://schemas.mediachase.com/ecf/view">
<Form>
<ButtonSets>
<ButtonSet placeName="StatusChanger">
<add>
<Button id="NewButton" text="New button text" commandName="btn_NewButtonCommand" width="170" disableMode="true" permissions="order:mng:edit"></Button>
</add>
</ButtonSet>
</ButtonSets>
</Form>
</View>
Modifying a button
In this example we remove the button "Cancel Shipment" in "ShipmentStatus", and replace it with a "CancelShipmentNew" button.
<?xml version="1.0" encoding="utf-8" ?>
<View xmlns="http://schemas.mediachase.com/ecf/view">
<Form>
<ButtonSets>
<ButtonSet placeName="StatusChanger">
<add>
<remove nodeId="CancelShipment" />
<Button id="CancelShipmentNew" text="Cancel shipment Modified" commandName="btn_CancelShipment" width="170" disableMode="true" permissions="order:mng:edit"> </Button>
</add>
</ButtonSet>
</ButtonSets>
</Form>
</View>
XML description
The control displays a set of buttons with the properties listed below.
- ClassName - class name, required to load XMLwith buttons, 1 parameter in XML.
- ViewName - view name, required to load XMLwith buttons, 2 parameters in XML.
- PlaceName - placeholder name, required to load XMLwith buttons, 3 parameters in XML.
- HolderMode - work mode (MetaView / ListViewUI), by default MetaView, defined which folder is used to load XML.
- Direction - defined how buttons are displayed (Vertical / Horizontal), default: Vertical.
- ColumnsCount - optional parameter, defines how manu columns are used to display button, if not defined, all buttons are displayed using one column or one row (depending on Direction attribute).
- Title - button text.
- ShowTitle - set to either true or false. Default is false. If true, the header defined in Title property will be displayed.
- ContainerId - helper parameter passed to each command for each button.
Do you find this information helpful? Please log in to provide feedback.
Last updated: May 28, 2015