Class sap.ndc.BarcodeScannerButtonModule: sap/ndc/BarcodeScannerButton

extends Control

A button control (displaying a bar code icon) to start the bar code scanning process. If the native scanning feature is not available, the button is either hidden or it provides a fallback by opening a dialog with an input field where the bar code can be entered manually.

Constructor Summary
new sap.ndc.BarcodeScannerButton(sId?, mSettings?)Constructor for a new BarcodeScannerButton.
Event Summary
inputLiveUpdate(oControlEvent)Event is fired when the text in the dialog's input field is changed.
scanFail(oControlEvent)Event is fired when the native scanning process is failed.
scanSuccess(oControlEvent)Event is fired when the scanning is finished or cancelled
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ndc.BarcodeScannerButton.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ndc.BarcodeScannerButton with name sClassName and enriches it with the information contained in oClassInfo.
sap.ndc.BarcodeScannerButton.getMetadata()Returns a metadata object for class sap.ndc.BarcodeScannerButton.
attachInputLiveUpdate(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the inputLiveUpdate event of this sap.ndc.BarcodeScannerButton.
attachScanFail(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the scanFail event of this sap.ndc.BarcodeScannerButton.
attachScanSuccess(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the scanSuccess event of this sap.ndc.BarcodeScannerButton.
detachInputLiveUpdate(fnFunction, oListener)Detaches event handler fnFunction from the inputLiveUpdate event of this sap.ndc.BarcodeScannerButton.
detachScanFail(fnFunction, oListener)Detaches event handler fnFunction from the scanFail event of this sap.ndc.BarcodeScannerButton.
detachScanSuccess(fnFunction, oListener)Detaches event handler fnFunction from the scanSuccess event of this sap.ndc.BarcodeScannerButton.
fireInputLiveUpdate(mArguments?)Fires event inputLiveUpdate to attached listeners.
fireScanFail(mArguments?)Fires event scanFail to attached listeners.
fireScanSuccess(mArguments?)Fires event scanSuccess to attached listeners.
getProvideFallback()Gets current value of property provideFallback.
getVisible()Gets current value of property visible.
getWidth()Gets current value of property width.
setProvideFallback(bProvideFallback)Sets a new value for property provideFallback.
setVisible(bVisible)Sets a new value for property visible.
setWidth(sWidth)Sets a new value for property width.
Constructor Detail
new sap.ndc.BarcodeScannerButton(sId?, mSettings?)
Constructor for a new BarcodeScannerButton.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.

The supported settings are:

  • Properties
  • Aggregations
    • Events
      • scanSuccess : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
      • scanFail : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
      • inputLiveUpdate : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

    In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.

    Parameters:
    {string}sId? id for the new control, generated automatically if no id is given
    {object}mSettings? initial settings for the new control
    Event Detail
    inputLiveUpdate(oControlEvent)
    Event is fired when the text in the dialog's input field is changed.
    Parameters:
    {sap.ui.base.Event}oControlEvent
    {sap.ui.base.EventProvider}oControlEvent.getSource
    {object}oControlEvent.getParameters
    {string}oControlEvent.getParameters.newValue The new value of the input field.
    scanFail(oControlEvent)
    Event is fired when the native scanning process is failed.
    Parameters:
    {sap.ui.base.Event}oControlEvent
    {sap.ui.base.EventProvider}oControlEvent.getSource
    {object}oControlEvent.getParameters
    scanSuccess(oControlEvent)
    Event is fired when the scanning is finished or cancelled
    Parameters:
    {sap.ui.base.Event}oControlEvent
    {sap.ui.base.EventProvider}oControlEvent.getSource
    {object}oControlEvent.getParameters
    {string}oControlEvent.getParameters.text The the text representation of the bar code data.
    {string}oControlEvent.getParameters.format The type of the bar code detected.
    {boolean}oControlEvent.getParameters.cancelled Indicates whether or not the user cancelled the scan.
    Method Detail
    sap.ndc.BarcodeScannerButton.extend(sClassName, oClassInfo?, FNMetaImpl?): function
    Creates a new subclass of class sap.ndc.BarcodeScannerButton with name sClassName and enriches it with the information contained in oClassInfo.

    oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

    Parameters:
    {string}sClassName Name of the class being created
    {object}oClassInfo? Object literal with information about the class
    {function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
    Returns:
    {function} Created class / constructor function
    sap.ndc.BarcodeScannerButton.getMetadata(): sap.ui.base.Metadata
    Returns a metadata object for class sap.ndc.BarcodeScannerButton.
    Returns:
    {sap.ui.base.Metadata} Metadata object describing this class
    attachInputLiveUpdate(oData?, fnFunction, oListener?): sap.ndc.BarcodeScannerButton
    Attaches event handler fnFunction to the inputLiveUpdate event of this sap.ndc.BarcodeScannerButton.

    When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ndc.BarcodeScannerButton itself.

    Event is fired when the text in the dialog's input field is changed.

    Parameters:
    {object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
    {function}fnFunction The function to be called when the event occurs
    {object}oListener? Context object to call the event handler with. Defaults to this sap.ndc.BarcodeScannerButton itself
    Returns:
    {sap.ndc.BarcodeScannerButton} Reference to this in order to allow method chaining
    attachScanFail(oData?, fnFunction, oListener?): sap.ndc.BarcodeScannerButton
    Attaches event handler fnFunction to the scanFail event of this sap.ndc.BarcodeScannerButton.

    When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ndc.BarcodeScannerButton itself.

    Event is fired when the native scanning process is failed.

    Parameters:
    {object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
    {function}fnFunction The function to be called when the event occurs
    {object}oListener? Context object to call the event handler with. Defaults to this sap.ndc.BarcodeScannerButton itself
    Returns:
    {sap.ndc.BarcodeScannerButton} Reference to this in order to allow method chaining
    attachScanSuccess(oData?, fnFunction, oListener?): sap.ndc.BarcodeScannerButton
    Attaches event handler fnFunction to the scanSuccess event of this sap.ndc.BarcodeScannerButton.

    When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ndc.BarcodeScannerButton itself.

    Event is fired when the scanning is finished or cancelled

    Parameters:
    {object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
    {function}fnFunction The function to be called when the event occurs
    {object}oListener? Context object to call the event handler with. Defaults to this sap.ndc.BarcodeScannerButton itself
    Returns:
    {sap.ndc.BarcodeScannerButton} Reference to this in order to allow method chaining
    detachInputLiveUpdate(fnFunction, oListener): sap.ndc.BarcodeScannerButton
    Detaches event handler fnFunction from the inputLiveUpdate event of this sap.ndc.BarcodeScannerButton.

    The passed function and listener object must match the ones used for event registration.

    Parameters:
    {function}fnFunction The function to be called, when the event occurs
    {object}oListener Context object on which the given function had to be called
    Returns:
    {sap.ndc.BarcodeScannerButton} Reference to this in order to allow method chaining
    detachScanFail(fnFunction, oListener): sap.ndc.BarcodeScannerButton
    Detaches event handler fnFunction from the scanFail event of this sap.ndc.BarcodeScannerButton.

    The passed function and listener object must match the ones used for event registration.

    Parameters:
    {function}fnFunction The function to be called, when the event occurs
    {object}oListener Context object on which the given function had to be called
    Returns:
    {sap.ndc.BarcodeScannerButton} Reference to this in order to allow method chaining
    detachScanSuccess(fnFunction, oListener): sap.ndc.BarcodeScannerButton
    Detaches event handler fnFunction from the scanSuccess event of this sap.ndc.BarcodeScannerButton.

    The passed function and listener object must match the ones used for event registration.

    Parameters:
    {function}fnFunction The function to be called, when the event occurs
    {object}oListener Context object on which the given function had to be called
    Returns:
    {sap.ndc.BarcodeScannerButton} Reference to this in order to allow method chaining
    fireInputLiveUpdate(mArguments?): sap.ndc.BarcodeScannerButton
    Fires event inputLiveUpdate to attached listeners.

    Expects the following event parameters:

    • newValue of type stringThe new value of the input field.
    Parameters:
    {Map}mArguments? The arguments to pass along with the event
    Returns:
    {sap.ndc.BarcodeScannerButton} Reference to this in order to allow method chaining
    fireScanFail(mArguments?): sap.ndc.BarcodeScannerButton
    Fires event scanFail to attached listeners.
    Parameters:
    {Map}mArguments? The arguments to pass along with the event
    Returns:
    {sap.ndc.BarcodeScannerButton} Reference to this in order to allow method chaining
    fireScanSuccess(mArguments?): sap.ndc.BarcodeScannerButton
    Fires event scanSuccess to attached listeners.

    Expects the following event parameters:

    • text of type stringThe the text representation of the bar code data.
    • format of type stringThe type of the bar code detected.
    • cancelled of type booleanIndicates whether or not the user cancelled the scan.
    Parameters:
    {Map}mArguments? The arguments to pass along with the event
    Returns:
    {sap.ndc.BarcodeScannerButton} Reference to this in order to allow method chaining
    getProvideFallback(): boolean
    Gets current value of property provideFallback.

    If set to true, the button remains visible if the scanner is not available and triggers a dialog to enter bar code.

    Default value is true.

    Returns:
    {boolean} Value of property provideFallback
    getVisible(): boolean
    Gets current value of property visible.

    The invisible bar code scanner button is not rendered regardless of the availability of the native scan feature.

    Default value is true.

    Returns:
    {boolean} Value of property visible
    getWidth(): sap.ui.core.CSSSize
    Gets current value of property width.

    Defines the width of the scanner button.

    Returns:
    {sap.ui.core.CSSSize} Value of property width
    setProvideFallback(bProvideFallback): sap.ndc.BarcodeScannerButton
    Sets a new value for property provideFallback.

    If set to true, the button remains visible if the scanner is not available and triggers a dialog to enter bar code.

    When called with a value of null or undefined, the default value of the property will be restored.

    Default value is true.

    Parameters:
    {boolean}bProvideFallback New value for property provideFallback
    Returns:
    {sap.ndc.BarcodeScannerButton} Reference to this in order to allow method chaining
    setVisible(bVisible): sap.ndc.BarcodeScannerButton
    Sets a new value for property visible.

    The invisible bar code scanner button is not rendered regardless of the availability of the native scan feature.

    When called with a value of null or undefined, the default value of the property will be restored.

    Default value is true.

    Parameters:
    {boolean}bVisible New value for property visible
    Returns:
    {sap.ndc.BarcodeScannerButton} Reference to this in order to allow method chaining
    setWidth(sWidth): sap.ndc.BarcodeScannerButton
    Sets a new value for property width.

    Defines the width of the scanner button.

    When called with a value of null or undefined, the default value of the property will be restored.

    Parameters:
    {sap.ui.core.CSSSize}sWidth New value for property width
    Returns:
    {sap.ndc.BarcodeScannerButton} Reference to this in order to allow method chaining