Class sap.suite.ui.commons.SplitButtonModule: sap/suite/ui/commons/SplitButton

extends Control

The Split Button Control is a composite control that consists of a default-action Button and a Menu Button control. The default-action button control represents a simple push button. It is used for initiating actions, such as save or print. It can contain some text, an icon, or both; the order of the two can be configured. The action initiated by this button is considered to be the default action for the control, and it must be one of the selections defined in the Menu Button menu. The Menu Button control is a button that opens a menu upon user's click. MenuButton is a composition of the Menu control and the Button control and thus inheriting all features. When a menu item is selected by the user, MenuButton throws an event called itemSelected. The event transfers the itemId of the selected item. As an alternative, the button press event can be used which has a similar behavior.

Deprecated API:Since version 1.34. Deprecated. Not Fiori.

Constructor Summary
new sap.suite.ui.commons.SplitButton(sId?, mSettings?)Constructor for a new SplitButton.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.suite.ui.commons.SplitButton.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.suite.ui.commons.SplitButton with name sClassName and enriches it with the information contained in oClassInfo.
sap.suite.ui.commons.SplitButton.getMetadata()Returns a metadata object for class sap.suite.ui.commons.SplitButton.
destroyMenu()Destroy the menu.
getEnabled()Getter for property enabled.
getIcon()Getter for property icon.
getIconFirst()Getter for property iconFirst.
getLite()Getter for property lite.
getMenu()Return the menu.
getStyle()Getter for property style.
getStyled()Getter for property styled.
getText()Getter for property text.
getVisible()Getter for property visible.
setEnabled(bEnabled)set enabled property for the control
setIcon(sIcon)set icon (image) to be displayed in action button
setIconFirst(bIconFirst)set if the icon for the action button be displayed before or after text
setLite(bLite)set lite property for the control
setMenu(oMenu, oMenuItem)Set the menu to the button and set menu item for the action button.
setStyle(oStyle)set style for the control
setStyled(bStyled)set if the control is styled or not
setText(sText)set text for the action button
setVisible(bVisible)Setter for property visible.
Constructor Detail
new sap.suite.ui.commons.SplitButton(sId?, mSettings?)
Constructor for a new SplitButton.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers.

If the name of a setting is ambiguous (e.g. a property has the same name as an event), then the framework assumes property, aggregation, association, event in that order. To override this automatic resolution, one of the prefixes "aggregation:", "association:" or "event:" can be added to the name of the setting (such a prefixed name must be enclosed in single or double quotes).

The supported settings are:

  • Properties
    • visible : boolean (default: true)
    • enabled : boolean (default: true)
    • lite : boolean (default: false)
    • style : sap.ui.commons.ButtonStyle (default: sap.ui.commons.ButtonStyle.Default)
    • styled : boolean (default: true)
    • iconFirst : boolean (default: true)
    • text : string (default: '')
    • icon : sap.ui.core.URI (default: '')
  • Aggregations
    • menu : sap.ui.commons.Menu
  • Associations
    • Events
      Parameters:
      {string}sId? id for the new control, generated automatically if no id is given
      {object}mSettings? initial settings for the new control
      Deprecated:
      Since version 1.34. Deprecated. Not Fiori.
      Method Detail
      sap.suite.ui.commons.SplitButton.extend(sClassName, oClassInfo?, FNMetaImpl?): function
      Creates a new subclass of class sap.suite.ui.commons.SplitButton with name sClassName and enriches it with the information contained in oClassInfo.

      oClassInfo might contain the same kind of informations as described in Element.extend.

      Parameters:
      {string}sClassName name of the class to be created
      {object}oClassInfo? object literal with informations about the class
      {function}FNMetaImpl? constructor function for the metadata object. If not given, it defaults to sap.ui.core.ElementMetadata.
      Returns:
      {function} the created class / constructor function
      sap.suite.ui.commons.SplitButton.getMetadata(): sap.ui.base.Metadata
      Returns a metadata object for class sap.suite.ui.commons.SplitButton.
      Returns:
      {sap.ui.base.Metadata} Metadata object describing this class
      destroyMenu(): sap.ui.commons.Menu
      Destroy the menu.
      Returns:
      {sap.ui.commons.Menu}
      getEnabled(): boolean
      Getter for property enabled. Boolean property to enable the control (default is true). Buttons that are disabled have other colors than enabled ones, depending on custom settings.

      Default value is true

      Returns:
      {boolean} the value of property enabled
      getIcon(): sap.ui.core.URI
      Getter for property icon. Icon to be displayed as graphical element within the action button.

      Default value is ''

      Returns:
      {sap.ui.core.URI} the value of property icon
      getIconFirst(): boolean
      Getter for property iconFirst. If set to true (default), the display sequence is 1. icon 2. control text .

      Default value is true

      Returns:
      {boolean} the value of property iconFirst
      getLite(): boolean
      Getter for property lite. The split button is rendered as lite split button.

      Default value is false

      Returns:
      {boolean} the value of property lite
      Return the menu.
      Returns:
      {sap.ui.commons.Menu}
      Getter for property style. Style of the control (e.g. emphasized, accept)

      Default value is sap.ui.commons.ButtonStyle.Default

      Returns:
      {sap.ui.commons.ButtonStyle} the value of property style
      getStyled(): boolean
      Getter for property styled. Indicatied if the button is styled. If not it is rendered as native HTML-button. In this case a custom styling can be added usig addStyleClass.

      Default value is true

      Returns:
      {boolean} the value of property styled
      getText(): string
      Getter for property text. Text to be displayed for the action button.

      Default value is ''

      Returns:
      {string} the value of property text
      getVisible(): boolean
      Getter for property visible. Invisible split buttons are not rendered

      Default value is true

      Returns:
      {boolean} the value of property visible
      setEnabled(bEnabled)
      set enabled property for the control
      Parameters:
      {boolean}bEnabled
      setIcon(sIcon)
      set icon (image) to be displayed in action button
      Parameters:
      {sap.ui.core.URI}sIcon
      setIconFirst(bIconFirst)
      set if the icon for the action button be displayed before or after text
      Parameters:
      {boolean}bIconFirst
      setLite(bLite)
      set lite property for the control
      Parameters:
      {boolean}bLite
      setMenu(oMenu, oMenuItem): sap.suite.ui.commons.SplitButton
      Set the menu to the button and set menu item for the action button. The menu item for action button must exist in the menu. If it doesn't exist the first menu item is set by default.
      Parameters:
      {sap.ui.commons.Menu}oMenu
      {sap.ui.commons.MenuItem}oMenuItem
      Returns:
      {sap.suite.ui.commons.SplitButton}this to allow method chaining
      setStyle(oStyle)
      set style for the control
      Parameters:
      {sap.ui.commons.ButtonStyle}oStyle
      setStyled(bStyled)
      set if the control is styled or not
      Parameters:
      {boolean}bStyled
      setText(sText)
      set text for the action button
      Parameters:
      {string}sText
      setVisible(bVisible): sap.suite.ui.commons.SplitButton
      Setter for property visible.

      Default value is true

      Parameters:
      {boolean}bVisible new value for property visible
      Returns:
      {sap.suite.ui.commons.SplitButton}this to allow method chaining