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

extends Control

The InPlaceEdit is a functionality to have text in display mode that can be changed in place.

Deprecated API:Since version 1.38.


Since: 1.8.0.
Constructor Summary
new sap.ui.commons.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.
liveChange(oControlEvent)This event if fired during typing into the InPlaceEdit and returns the currently entered value.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.commons.InPlaceEdit.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.commons.InPlaceEdit with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.commons.InPlaceEdit.getMetadata()Returns a metadata object for class sap.ui.commons.InPlaceEdit.
attachChange(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the change event of this sap.ui.commons.InPlaceEdit.
attachLiveChange(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the liveChange event of this sap.ui.commons.InPlaceEdit.
clearOldText()Clear the old text after a change to disable the undo functionality.
destroyContent()Destroys the content in the aggregation content.
detachChange(fnFunction, oListener)Detaches event handler fnFunction from the change event of this sap.ui.commons.InPlaceEdit.
detachLiveChange(fnFunction, oListener)Detaches event handler fnFunction from the liveChange event of this sap.ui.commons.InPlaceEdit.
fireChange(mArguments?)Fires event change to attached listeners.
fireLiveChange(mArguments?)Fires event liveChange to attached listeners.
getContent()Gets content of aggregation content.
getDesign()Gets current value of property design.
getTooltip()Returns the tooltip for this InPlaceEdit if any or an undefined value.
getUndoEnabled()Gets current value of property undoEnabled.
getValueState()Gets current value of property valueState.
setContent(oContent)Sets the aggregated content.
setDesign(sDesign)Sets a new value for property design.
setTooltip(oTooltip)Sets a new tooltip for this InPlaceEdit.
setUndoEnabled(bUndoEnabled)Sets a new value for property undoEnabled.
setValueState(sValueState)Sets a new value for property valueState.
Constructor Detail
new sap.ui.commons.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. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.

The supported settings are:

  • Properties
    • valueState : sap.ui.core.ValueState (default: None)
    • undoEnabled : boolean (default: true)
    • design : sap.ui.commons.TextViewDesign (default: Standard)
  • Aggregations
    • content : sap.ui.core.Control (default)
  • Events
    • change : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • liveChange : 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
Deprecated:
Since version 1.38.
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.
liveChange(oControlEvent)
This event if fired during typing into the InPlaceEdit and returns the currently entered value. This is not the content of the value property. The value property is only updated by ENTER and by leaving the control.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{string}oControlEvent.getParameters.liveValue Current value of the Textfield.
Since:
1.16.5
Method Detail
sap.ui.commons.InPlaceEdit.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.commons.InPlaceEdit 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.ui.commons.InPlaceEdit.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.commons.InPlaceEdit.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
attachChange(oData?, fnFunction, oListener?): sap.ui.commons.InPlaceEdit
Attaches event handler fnFunction to the change event of this sap.ui.commons.InPlaceEdit.

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.ui.commons.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 be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.ui.commons.InPlaceEdit itself
Returns:
{sap.ui.commons.InPlaceEdit} Reference to this in order to allow method chaining
attachLiveChange(oData?, fnFunction, oListener?): sap.ui.commons.InPlaceEdit
Attaches event handler fnFunction to the liveChange event of this sap.ui.commons.InPlaceEdit.

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.ui.commons.InPlaceEdit itself.

This event if fired during typing into the InPlaceEdit and returns the currently entered value. This is not the content of the value property. The value property is only updated by ENTER and by leaving the control.

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.ui.commons.InPlaceEdit itself
Since:
1.16.5
Returns:
{sap.ui.commons.InPlaceEdit} Reference to this in order to allow method chaining
clearOldText()
Clear the old text after a change to disable the undo functionality. If undoEnabled is false this has no effect.
destroyContent(): sap.ui.commons.InPlaceEdit
Destroys the content in the aggregation content.
Returns:
{sap.ui.commons.InPlaceEdit} Reference to this in order to allow method chaining
detachChange(fnFunction, oListener): sap.ui.commons.InPlaceEdit
Detaches event handler fnFunction from the change event of this sap.ui.commons.InPlaceEdit.

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.ui.commons.InPlaceEdit} Reference to this in order to allow method chaining
detachLiveChange(fnFunction, oListener): sap.ui.commons.InPlaceEdit
Detaches event handler fnFunction from the liveChange event of this sap.ui.commons.InPlaceEdit.

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
Since:
1.16.5
Returns:
{sap.ui.commons.InPlaceEdit} Reference to this in order to allow method chaining
fireChange(mArguments?): sap.ui.commons.InPlaceEdit
Fires event change to attached listeners.

Expects the following event parameters:

  • newValue of type stringThe new / changed value of the InPlaceEdit.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.commons.InPlaceEdit} Reference to this in order to allow method chaining
fireLiveChange(mArguments?): sap.ui.commons.InPlaceEdit
Fires event liveChange to attached listeners.

Expects the following event parameters:

  • liveValue of type stringCurrent value of the Textfield.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Since:
1.16.5
Returns:
{sap.ui.commons.InPlaceEdit} Reference to this in order to allow method chaining
getAccessibilityInfo()
See:
{sap.ui.core.Control#getAccessibilityInfo}
getContent(): sap.ui.core.Control
Gets content of aggregation content.

Content control of the InPlaceEdit. The following controls are allowed: TextField, ComboBox, DropdownBox and Link

Returns:
{sap.ui.core.Control}
Gets current value of property design.

Defines the visual appearance of the control. Currently this is not supported for Labels.

Default value is Standard.

Since:
1.9.0
Returns:
{sap.ui.commons.TextViewDesign} Value of property design
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
Gets current value of property undoEnabled.

If undo is enabled after changing the text an undo button appears.

Default value is true.

Returns:
{boolean} Value of property undoEnabled
getValueState(): sap.ui.core.ValueState
Gets current value of 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} Value of property valueState
setContent(oContent): sap.ui.commons.InPlaceEdit
Sets the aggregated content.
Parameters:
{sap.ui.core.Control}oContent The content to set
Returns:
{sap.ui.commons.InPlaceEdit} Reference to this in order to allow method chaining
setDesign(sDesign): sap.ui.commons.InPlaceEdit
Sets a new value for property design.

Defines the visual appearance of the control. Currently this is not supported for Labels.

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

Default value is Standard.

Parameters:
{sap.ui.commons.TextViewDesign}sDesign New value for property design
Since:
1.9.0
Returns:
{sap.ui.commons.InPlaceEdit} Reference to this in order to allow method chaining
setTooltip(oTooltip): sap.ui.commons.InPlaceEdit
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 Tooltip as string or RichTooltip.
Returns:
{sap.ui.commons.InPlaceEdit}this to allow method chaining
setUndoEnabled(bUndoEnabled): sap.ui.commons.InPlaceEdit
Sets a new value for property undoEnabled.

If undo is enabled after changing the text an undo button appears.

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

Default value is true.

Parameters:
{boolean}bUndoEnabled New value for property undoEnabled
Returns:
{sap.ui.commons.InPlaceEdit} Reference to this in order to allow method chaining
setValueState(sValueState): sap.ui.commons.InPlaceEdit
Sets a new value 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.

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

Default value is None.

Parameters:
{sap.ui.core.ValueState}sValueState New value for property valueState
Returns:
{sap.ui.commons.InPlaceEdit} Reference to this in order to allow method chaining