The InPlaceEdit is a functionality to have text in display mode that can be changed in place.
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#constructor for a general description of the syntax of the settings object.
new sap.ui.commons.InPlaceEdit(sId?, mSettings?)
Param | Type | Default Value | Description |
---|---|---|---|
sId? | string | id for the new control, generated automatically if no id is given |
|
mSettings? | object | initial settings for the new control |
Name | Type | Default Value | Description |
---|---|---|---|
design | sap.ui.commons.TextViewDesign | Standard | Defines the visual appearance of the control. Currently this is not supported for Labels. |
undoEnabled | boolean | true | If undo is enabled after changing the text an undo button appears. Visibility: public |
valueState | sap.ui.core.ValueState | None | 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. Visibility: public |
Default Aggregation: content
Name | Cardinality | Type | Description |
---|---|---|---|
content (default) | 0..1 | sap.ui.core.Control |
Content control of the InPlaceEdit. The following controls are allowed: TextField, ComboBox, DropdownBox and Link |
Event | Description |
---|---|
change |
Event is fired when the text in the field has changed AND the focus leaves the InPlaceEdit or the Enter key is pressed. |
liveChange |
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. |
Event is fired when the text in the field has changed AND the focus leaves the InPlaceEdit or the Enter key is pressed.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
newValue | string |
The new / changed value of the InPlaceEdit. |
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.
Since: 1.16.5.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
liveValue | string |
Current value of the Textfield. |
Method | Description |
---|---|
attachChange |
Attaches event handler When called, the context of the event handler (its Event is fired when the text in the field has changed AND the focus leaves the InPlaceEdit or the Enter key is pressed. |
attachLiveChange |
Attaches event handler When called, the context of the event handler (its 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. |
clearOldText |
Clear the old text after a change to disable the undo functionality. If undoEnabled is false this has no effect. |
destroyContent |
Destroys the content in the aggregation content. |
detachChange |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachLiveChange |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.ui.commons.InPlaceEdit.extend |
Creates a new subclass of class sap.ui.commons.InPlaceEdit with name
|
fireChange |
Fires event change to attached listeners. |
fireLiveChange |
Fires event liveChange to attached listeners. |
getAccessibilityInfo |
References:
|
getContent |
Gets content of aggregation content. Content control of the InPlaceEdit. The following controls are allowed: TextField, ComboBox, DropdownBox and Link |
getDesign |
Gets current value of property design. Defines the visual appearance of the control. Currently this is not supported for Labels. Default value is |
sap.ui.commons.InPlaceEdit.getMetadata |
Returns a metadata object for class sap.ui.commons.InPlaceEdit. |
getTooltip |
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 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. |
getUndoEnabled |
Gets current value of property undoEnabled. If undo is enabled after changing the text an undo button appears. Default value is |
getValueState |
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 |
setContent |
Sets the aggregated content. |
setDesign |
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 Default value is |
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 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. |
setUndoEnabled |
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 Default value is |
setValueState |
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 Default value is |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Clear the old text after a change to disable the undo functionality. If undoEnabled is false this has no effect.
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |
Fires event change to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
newValue | string |
The new / changed value of the InPlaceEdit. |
Fires event liveChange to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
liveValue | string |
Current value of the Textfield. |
Gets content of aggregation content.
Content control of the InPlaceEdit. The following controls are allowed: TextField, ComboBox, DropdownBox and Link
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 a metadata object for class sap.ui.commons.InPlaceEdit.
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.
Gets current value of property undoEnabled.
If undo is enabled after changing the text an undo button appears.
Default value is true
.
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
.
Sets the aggregated content.
Param | Type | DefaultValue | Description |
---|---|---|---|
oContent | sap.ui.core.Control |
The content to set |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sDesign | sap.ui.commons.TextViewDesign | Standard |
New value for property |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
oTooltip | string sap.ui.core.TooltipBase |
Tooltip as string or RichTooltip. |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bUndoEnabled | boolean | true |
New value for property |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sValueState | sap.ui.core.ValueState | None |
New value for property |