HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsGitHubNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

ButtonsHolder

Describes how to add and modify buttons using ButtonsHolder in Optimizely Commerce Connect, a set of buttons with commands and handlers defined in a special XML section.

📘

Note

This content does not apply to Commerce Connect versions 14+.

ButtonsHolder is a set of buttons with commands and handlers defined in a special XML section. You can describe ButtonsHolder in the View/ListViewUI/ButtonSet section when using it in a separate page. Or, you can use it inside an XmlFormBuilder-like view, in the View/Form/ButtonSets/ButtonSet section.

Add a button

The following example shows how to add a button to ShipmentStatus by putting the PurchaseOrder-ObjectView.OrderShipment.xml file into the ~/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>

Modify a button

The following example shows how to replace the Cancel Shipment button in ShipmentStatus 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 following properties.

  • 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 XML with buttons, 3 parameters in XML.
  • HolderMode – Work mode (MetaView / ListViewUI), by default MetaView; defines folder used to load XML.
  • Direction – Defines how buttons are displayed (Vertical / Horizontal); default: Vertical.
  • ColumnsCount – Optional parameter, defines number of columns used to display button, if not defined, all buttons are displayed using one column or one row (depending on the Direction attribute).
  • Title – text.
  • ShowTitle – Set to either true or false. Default is false. If true, the header defined in Title property is displayed.
  • ContainerId – Helper parameter passed to each command for each button.