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(mParameters?)Fires event change to attached listeners.
fireLiveChange(mParameters?)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:
stringsId?id for the new control, generated automatically if no id is given
objectmSettings?initial settings for the new control
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.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
stringoControlEvent.getParameters.newValueThe 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.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
stringoControlEvent.getParameters.liveValueCurrent 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:
stringsClassNameName of the class being created
objectoClassInfo?Object literal with information about the class
functionFNMetaImpl?Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
functionCreated 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.MetadataMetadata 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:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.ui.commons.InPlaceEdit itself
Returns:
sap.ui.commons.InPlaceEditReference 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:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.ui.commons.InPlaceEdit itself
Returns:
sap.ui.commons.InPlaceEditReference to this in order to allow method chaining
Since:
1.16.5
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.InPlaceEditReference 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:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.ui.commons.InPlaceEditReference 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:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.ui.commons.InPlaceEditReference to this in order to allow method chaining
Since:
1.16.5
fireChange(mParameters?): sap.ui.commons.InPlaceEdit
Fires event change to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
stringmParameters.newValue?The new / changed value of the InPlaceEdit.
Returns:
sap.ui.commons.InPlaceEditReference to this in order to allow method chaining
fireLiveChange(mParameters?): sap.ui.commons.InPlaceEdit
Fires event liveChange to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
stringmParameters.liveValue?Current value of the Textfield.
Returns:
sap.ui.commons.InPlaceEditReference to this in order to allow method chaining
Since:
1.16.5
getAccessibilityInfo(): Object
Returns:
ObjectCurrent accessibility state of the control.
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.

Returns:
sap.ui.commons.TextViewDesignValue of property design
Since:
1.9.0
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.TooltipBaseThe 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:
booleanValue 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 an own valueState property this will be used.

Default value is None.

Returns:
sap.ui.core.ValueStateValue of property valueState
setContent(oContent): sap.ui.commons.InPlaceEdit
Sets the aggregated content.
Parameters:
sap.ui.core.ControloContentThe content to set
Returns:
sap.ui.commons.InPlaceEditReference 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.TextViewDesignsDesignNew value for property design
Returns:
sap.ui.commons.InPlaceEditReference to this in order to allow method chaining
Since:
1.9.0
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.TooltipBaseoTooltipTooltip as string or RichTooltip.
Returns:
sap.ui.commons.InPlaceEditthis 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:
booleanbUndoEnabledNew value for property undoEnabled
Returns:
sap.ui.commons.InPlaceEditReference 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 an 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.ValueStatesValueStateNew value for property valueState
Returns:
sap.ui.commons.InPlaceEditReference to this in order to allow method chaining