The ObjectAttribute control displays a text field that can be normal or active. The ObjectAttribute fires a press event when the user selects active text.
Since: 1.12.
Event Summary
press(oControlEvent)Fires when the user clicks on active text. Method Summary
sap.m.ObjectAttribute.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.ObjectAttribute with name sClassName
and enriches it with the information contained in oClassInfo
. attachPress(oData?, fnFunction, oListener?)Attaches event handler fnFunction
to the press
event of this sap.m.ObjectAttribute
. detachPress(fnFunction, oListener)Detaches event handler fnFunction
from the press
event of this sap.m.ObjectAttribute
. firePress(mArguments?)Fires event press
to attached listeners. getActive()Gets current value of property active
. getText()Gets current value of property text
. getTitle()Gets current value of property title
. setActive(bActive)Sets a new value for property active
. setText(sText)Sets a new value for property text
. setTitle(sTitle)Sets a new value for property title
. 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,
getTooltip_AsString,
getTooltip_Text,
indexOfCustomData,
indexOfDependent,
insertCustomData,
insertDependent,
prop,
removeAllCustomData,
removeAllDependents,
removeCustomData,
removeDependent,
removeEventDelegate,
setLayoutData,
setTooltip,
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.m.ObjectAttribute(sId?, mSettings?)
Constructor for a new ObjectAttribute.
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
- Aggregations
- Events
- press : 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 |
Event Detail
press(oControlEvent)
Fires when the user clicks on active text.
Parameters:
{sap.ui.base.Event} | oControlEvent | |
{sap.ui.base.EventProvider} | oControlEvent.getSource | |
{object} | oControlEvent.getParameters | |
{string} | oControlEvent.getParameters.domRef | DOM reference of the ObjectAttribute's text to be used for positioning. |
Method Detail
sap.m.ObjectAttribute.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.ObjectAttribute 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 |
Returns a metadata object for class sap.m.ObjectAttribute.
Returns:
Attaches event handler
fnFunction
to the
press
event of this
sap.m.ObjectAttribute
.
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.m.ObjectAttribute
itself.
Fires when the user clicks on active text.
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.m.ObjectAttribute itself |
Returns:
Destroys the customContent in the aggregation customContent
.
Returns:
Detaches event handler
fnFunction
from the
press
event of this
sap.m.ObjectAttribute
.
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:
Fires event
press
to attached listeners.
Expects the following event parameters:
domRef
of type string
DOM reference of the ObjectAttribute's text to be used for positioning.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
getActive(): boolean
Gets current value of property
active
.
Indicates if the ObjectAttribute text is selectable for the user.
Returns:
{boolean} | Value of property active |
Gets content of aggregation
customContent
.
When the aggregation is set, it replaces the text, active and textDirection properties. This also ignores the press event. The provided control is displayed as an active link. Note: It will only allow sap.m.Text and sap.m.Link controls.
Returns:
getPopupAnchorDomRef(): DomNode
Defines to which DOM reference the Popup should be docked.
Returns:
{DomNode} | The DOM reference that Popup should dock to |
getText(): string
Gets current value of property
text
.
Defines the ObjectAttribute text.
Returns:
{string} | Value of property text |
Gets current value of property
textDirection
.
Determines the direction of the text, not including the title. Available options for the text direction are LTR (left-to-right) and RTL (right-to-left). By default the control inherits the text direction from its parent control.
Default value is Inherit
.
Returns:
getTitle(): string
Gets current value of property
title
.
Defines the ObjectAttribute title.
Returns:
{string} | Value of property title |
Sets a new value for property
active
.
Indicates if the ObjectAttribute text is selectable for the user.
When called with a value of null
or undefined
, the default value of the property will be restored.
Parameters:
{boolean} | bActive | New value for property active |
Returns:
Sets the aggregated customContent
.
Parameters:
Returns:
Sets a new value for property
text
.
Defines the ObjectAttribute text.
When called with a value of null
or undefined
, the default value of the property will be restored.
Parameters:
{string} | sText | New value for property text |
Returns:
Sets a new value for property
textDirection
.
Determines the direction of the text, not including the title. Available options for the text direction are LTR (left-to-right) and RTL (right-to-left). By default the control inherits the text direction from its parent control.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Inherit
.
Parameters:
Returns:
Sets a new value for property
title
.
Defines the ObjectAttribute title.
When called with a value of null
or undefined
, the default value of the property will be restored.
Parameters:
{string} | sTitle | New value for property title |
Returns: