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.
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. 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
. 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. getTooltip()Returns the tooltip for this InPlaceEdit if any or an undefined value. setContent(oContent)Setter for the aggregated content
. setTooltip()Sets a new tooltip for this InPlaceEdit. addStyleClass,
allowTextSelection,
attachBrowserEvent,
attachValidateFieldGroup,
checkFieldGroupIds,
clone,
detachBrowserEvent,
detachValidateFieldGroup,
fireValidateFieldGroup,
getAccessibilityInfo,
getBusy,
getBusyIndicatorDelay,
getControlsByFieldGroupId,
getFieldGroupIds,
getIdForLabel,
getRenderer,
getVisible,
hasStyleClass,
invalidate,
isBusy,
onAfterRendering,
onBeforeRendering,
placeAt,
removeStyleClass,
rerender,
setBusy,
setBusyIndicatorDelay,
setFieldGroupIds,
setVisible,
toggleStyleClass,
triggerValidateFieldGroup $,
addCustomData,
addDependent,
addEventDelegate,
applyFocusInfo,
bindElement,
data,
destroy,
destroyCustomData,
destroyDependents,
destroyLayoutData,
destroyTooltip,
enhanceAccessibilityState,
exit,
findElements,
fireEvent,
focus,
getCustomData,
getDependents,
getDomRef,
getElementBinding,
getFocusDomRef,
getFocusInfo,
getInterface,
getLayoutData,
getMetadata,
getTooltip_AsString,
getTooltip_Text,
indexOfCustomData,
indexOfDependent,
init,
insertCustomData,
insertDependent,
prop,
removeAllCustomData,
removeAllDependents,
removeCustomData,
removeDependent,
removeEventDelegate,
setLayoutData,
toString,
unbindElement addAggregation,
addAssociation,
applySettings,
attachFormatError,
attachModelContextChange,
attachParseError,
attachValidationError,
attachValidationSuccess,
bindAggregation,
bindContext,
bindObject,
bindProperty,
destroyAggregation,
detachFormatError,
detachModelContextChange,
detachParseError,
detachValidationError,
detachValidationSuccess,
findAggregatedObjects,
fireFormatError,
fireModelContextChange,
fireParseError,
fireValidationError,
fireValidationSuccess,
getAggregation,
getAssociation,
getBinding,
getBindingContext,
getBindingInfo,
getBindingPath,
getEventingParent,
getId,
getModel,
getObjectBinding,
getOriginInfo,
getParent,
getProperty,
hasModel,
indexOfAggregation,
insertAggregation,
isBound,
isInvalidateSuppressed,
isTreeBinding,
propagateMessages,
removeAggregation,
removeAllAggregation,
removeAllAssociation,
removeAssociation,
setAggregation,
setAssociation,
setBindingContext,
setModel,
setProperty,
unbindAggregation,
unbindContext,
unbindObject,
unbindProperty,
validateAggregation,
validateProperty 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:
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 |
Returns a metadata object for class sap.ca.ui.InPlaceEdit.
Returns:
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:
clearOldText(): void
Clear the old text after a change to disable the undo functionality. If undoEnabled is false this has no effect.
Destroys the content in the aggregation named content
.
Returns:
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:
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:
Getter for aggregation content
.
Content control of the InPlaceEdit. The following control is allowed: sap.m.Input, sap.m.Link
Returns:
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:
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 |
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:
Setter for the aggregated content
.
Parameters:
Returns:
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:
Setter for property
undoEnabled
.
Default value is false
Parameters:
{boolean} | bUndoEnabled | new value for property undoEnabled |
Returns:
Setter for property
valueState
.
Default value is None
Parameters:
Returns: