The ObjectAttribute
control displays a text field that can be normal or active. The ObjectAttribute
fires a press
event when the user chooses the active text.
Note: If property active
is set to true
, only the value of the text
property is styled and acts as a link. In this case the text
property must also be set, as otherwise there will be no link displayed for the user.
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#constructor for a general description of the syntax of the settings object.
new sap.m.ObjectAttribute(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 |
---|---|---|---|
active | boolean | Indicates if the Note: As of version 1.48, only the value of the |
|
text | string | Defines the ObjectAttribute text. Visibility: public |
|
textDirection | sap.ui.core.TextDirection | Inherit | Determines the direction of the text. Available options for the text direction are LTR (left-to-right), RTL (right-to-left), or Inherit. By default the control inherits the text direction from its parent control. Visibility: public |
title | string | Defines the ObjectAttribute title. Visibility: public |
Default Aggregation:
Name | Cardinality | Type | Description |
---|---|---|---|
_textControl | 0..1 | sap.ui.core.Control |
Text control to display title and text property. |
customContent | 0..1 | sap.ui.core.Control |
When the aggregation is set, it replaces the |
Method | Description |
---|---|
attachPress |
Attaches event handler When called, the context of the event handler (its Fires when the user clicks on active text. |
destroyCustomContent |
Destroys the customContent in the aggregation customContent. |
detachPress |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.m.ObjectAttribute.extend |
Creates a new subclass of class sap.m.ObjectAttribute with name
|
firePress |
Fires event press to attached listeners. |
getActive |
Gets current value of property active. Indicates if the Note: As of version 1.48, only the value of the |
getCustomContent |
Gets content of aggregation customContent. When the aggregation is set, it replaces the |
sap.m.ObjectAttribute.getMetadata |
Returns a metadata object for class sap.m.ObjectAttribute. |
getPopupAnchorDomRef |
Defines to which DOM reference the Popup should be docked. |
getText |
Gets current value of property text. Defines the ObjectAttribute text. |
getTextDirection |
Gets current value of property textDirection. Determines the direction of the text. Available options for the text direction are LTR (left-to-right), RTL (right-to-left), or Inherit. By default the control inherits the text direction from its parent control. Default value is |
getTitle |
Gets current value of property title. Defines the ObjectAttribute title. |
setActive |
Sets a new value for property active. Indicates if the Note: As of version 1.48, only the value of the When called with a value of |
setCustomContent |
Sets the aggregated customContent. |
setText |
Sets a new value for property text. Defines the ObjectAttribute text. When called with a value of |
setTextDirection |
Sets a new value for property textDirection. Determines the direction of the text. Available options for the text direction are LTR (left-to-right), RTL (right-to-left), or Inherit. By default the control inherits the text direction from its parent control. When called with a value of Default value is |
setTitle |
Sets a new value for property title. Defines the ObjectAttribute title. When called with a value of |
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.
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 |
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.
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.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.
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 press to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
domRef | string |
DOM reference of the ObjectAttribute's text to be used for positioning. |
Gets current value of property active.
Indicates if the ObjectAttribute
text is selectable for the user.
Note: As of version 1.48, only the value of the text
property becomes active (styled and acts like a link) as opposed to both the title
and text
in the previous versions. If you set this property to true
, you have to also set the text
property. Note: When active
property is set to true
, and the text direction of the title
or the text
does not match the text direction of the application, the textDirection
property should be set to ensure correct display.
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 in case it is a sap.m.Link. Note: It will only allow sap.m.Text and sap.m.Link controls.
Gets current value of property textDirection.
Determines the direction of the text. Available options for the text direction are LTR (left-to-right), RTL (right-to-left), or Inherit. By default the control inherits the text direction from its parent control.
Default value is Inherit
.
Sets a new value for property active.
Indicates if the ObjectAttribute
text is selectable for the user.
Note: As of version 1.48, only the value of the text
property becomes active (styled and acts like a link) as opposed to both the title
and text
in the previous versions. If you set this property to true
, you have to also set the text
property. Note: When active
property is set to true
, and the text direction of the title
or the text
does not match the text direction of the application, the textDirection
property should be set to ensure correct display.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
bActive | boolean |
New value for property |
Sets the aggregated customContent.
Param | Type | DefaultValue | Description |
---|---|---|---|
oCustomContent | sap.ui.core.Control |
The customContent to set |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
sText | string |
New value for property |
Sets a new value for property textDirection.
Determines the direction of the text. Available options for the text direction are LTR (left-to-right), RTL (right-to-left), or Inherit. 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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sTextDirection | sap.ui.core.TextDirection | Inherit |
New value for property |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
sTitle | string |
New value for property |