Class sap.ca.ui.InPlaceEditModule: sap/ca/ui/InPlaceEdit

extends Control

This control is used to switch between readonly and edit modes. A typical use case would be to change the value of a Label.

Deprecated API:Since version 1.22. This control is not required anymore as per central UX requirements. Please use sap.m.Input instead! This control will not be supported anymore.

Constructor Summary
new sap.ca.ui.InPlaceEdit(sId?, mSettings?)Constructor for a new InPlaceEdit.
Event Summary
change(oControlEvent)Event is fired when the text in the field has changed AND the focus leaves the InPlaceEdit or the Enter key is pressed.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ca.ui.InPlaceEdit.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ca.ui.InPlaceEdit with name sClassName and enriches it with the information contained in oClassInfo.
sap.ca.ui.InPlaceEdit.getMetadata()Returns a metadata object for class sap.ca.ui.InPlaceEdit.
attachChange(oData?, fnFunction, oListener?)Attach event handler fnFunction to the 'change' event of this sap.ca.ui.InPlaceEdit.
clearOldText()Clear the old text after a change to disable the undo functionality.
destroyContent()Destroys the content in the aggregation named content.
detachChange(fnFunction, oListener)Detach event handler fnFunction from the 'change' event of this sap.ca.ui.InPlaceEdit.
fireChange(mArguments?)Fire event change to attached listeners.
getContent()Getter for aggregation content.
getTooltip()Returns the tooltip for this InPlaceEdit if any or an undefined value.
getUndoEnabled()Getter for property undoEnabled.
getValueState()Getter for property valueState.
setContent(oContent)Setter for the aggregated content.
setTooltip()Sets a new tooltip for this InPlaceEdit.
setUndoEnabled(bUndoEnabled)Setter for property undoEnabled.
setValueState(oValueState)Setter for property valueState.
Constructor Detail
new sap.ca.ui.InPlaceEdit(sId?, mSettings?)
Constructor for a new InPlaceEdit.

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
    • valueState : sap.ui.core.ValueState (default: sap.ui.core.ValueState.None)
    • undoEnabled : boolean (default: false)
  • Aggregations
  • Associations
    • Events
      • change : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    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.22. This control is not required anymore as per central UX requirements. Please use sap.m.Input instead! This control will not be supported anymore.
    Event Detail
    change(oControlEvent)
    Event is fired when the text in the field has changed AND the focus leaves the InPlaceEdit or the Enter key is pressed.
    Parameters:
    {sap.ui.base.Event}oControlEvent
    {sap.ui.base.EventProvider}oControlEvent.getSource
    {object}oControlEvent.getParameters
    {string}oControlEvent.getParameters.newValue The new / changed value of the InPlaceEdit.
    Method Detail
    sap.ca.ui.InPlaceEdit.extend(sClassName, oClassInfo?, FNMetaImpl?): function
    Creates a new subclass of class sap.ca.ui.InPlaceEdit 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.ca.ui.InPlaceEdit.getMetadata(): sap.ui.base.Metadata
    Returns a metadata object for class sap.ca.ui.InPlaceEdit.
    Returns:
    {sap.ui.base.Metadata} Metadata object describing this class
    attachChange(oData?, fnFunction, oListener?): sap.ca.ui.InPlaceEdit
    Attach event handler fnFunction to the 'change' event of this sap.ca.ui.InPlaceEdit.
    . When called, the context of the event handler (its this) will be bound to oListener if specified otherwise to this sap.ca.ui.InPlaceEdit.
    itself.

    Event is fired when the text in the field has changed AND the focus leaves the InPlaceEdit or the Enter key is pressed.

    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 call, when the event occurs.
    {object}oListener? Context object to call the event handler with. Defaults to this sap.ca.ui.InPlaceEdit.
    itself.
    Returns:
    {sap.ca.ui.InPlaceEdit}this to allow method chaining
    clearOldText(): void
    Clear the old text after a change to disable the undo functionality. If undoEnabled is false this has no effect.
    destroyContent(): sap.ca.ui.InPlaceEdit
    Destroys the content in the aggregation named content.
    Returns:
    {sap.ca.ui.InPlaceEdit}this to allow method chaining
    detachChange(fnFunction, oListener): sap.ca.ui.InPlaceEdit
    Detach event handler fnFunction from the 'change' event of this sap.ca.ui.InPlaceEdit.

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

    Parameters:
    {function}fnFunction The function to call, when the event occurs.
    {object}oListener Context object on which the given function had to be called.
    Returns:
    {sap.ca.ui.InPlaceEdit}this to allow method chaining
    fireChange(mArguments?): sap.ca.ui.InPlaceEdit
    Fire event change to attached listeners.

    Expects following event parameters:

    • 'newValue' of type string The new / changed value of the InPlaceEdit.
    Parameters:
    {Map}mArguments? the arguments to pass along with the event.
    Returns:
    {sap.ca.ui.InPlaceEdit}this to allow method chaining
    getContent(): sap.ui.core.Control
    Getter for aggregation content.
    Content control of the InPlaceEdit. The following control is allowed: sap.m.Input, sap.m.Link
    Returns:
    {sap.ui.core.Control}
    getTooltip(): string|sap.ui.core.TooltipBase
    Returns the tooltip for this InPlaceEdit if any or an undefined value. The tooltip can either be a simple string or a subclass of sap.ui.core.TooltipBase.

    Callers that are only interested in tooltips of type string (e.g. to render them as a title attribute), should call the convenience method getTooltip_AsString instead. If they want to get a tooltip text no matter where it comes from (be it a string tooltip or the text from a TooltipBase instance) then they could call getTooltip_Text instead.

    If a content control is assigned to the InPlaceEdit the tooltip of this control is used. A directly set tooltip to the InPlaceEdit is ignored in this case.

    Returns:
    {string|sap.ui.core.TooltipBase} The tooltip for this Element.
    getUndoEnabled(): boolean
    Getter for property undoEnabled. If undo is enabled after changing the text an undo button appears.

    Default value is false

    Returns:
    {boolean} the value of property undoEnabled
    getValueState(): sap.ui.core.ValueState
    Getter for property valueState. Visualizes warnings or errors related to the InPlaceEdit. Possible values: Warning, Error, Success. If the content control has a own valueState property this will be used.

    Default value is None

    Returns:
    {sap.ui.core.ValueState} the value of property valueState
    setContent(oContent): sap.ca.ui.InPlaceEdit
    Setter for the aggregated content.
    Parameters:
    {sap.ui.core.Control}oContent
    Returns:
    {sap.ca.ui.InPlaceEdit}this to allow method chaining
    setTooltip()
    Sets a new tooltip for this InPlaceEdit. The tooltip can either be a simple string (which in most cases will be rendered as the title attribute of this Element) or an instance of sap.ui.core.TooltipBase.

    If a new tooltip is set, any previously set tooltip is deactivated.

    If a content control is assigned to the InPlaceEdit the tooltip of this control is used. A directly set tooltip to the InPlaceEdit is ignored in this case.

    Parameters:
    {string|sap.ui.core.TooltipBase}oTooltip.
    setUndoEnabled(bUndoEnabled): sap.ca.ui.InPlaceEdit
    Setter for property undoEnabled.

    Default value is false

    Parameters:
    {boolean}bUndoEnabled new value for property undoEnabled
    Returns:
    {sap.ca.ui.InPlaceEdit}this to allow method chaining
    setValueState(oValueState): sap.ca.ui.InPlaceEdit
    Setter for property valueState.

    Default value is None

    Parameters:
    {sap.ui.core.ValueState}oValueState new value for property valueState
    Returns:
    {sap.ca.ui.InPlaceEdit}this to allow method chaining