Class sap.m.FeedInputModule: sap/m/FeedInput

extends Control

The Feed Input allows the user to enter text for a new feed entry and then post it.


Since: 1.22.
Constructor Summary
new sap.m.FeedInput(sId?, mSettings?)Constructor for a new FeedInput.
Event Summary
post(oControlEvent)The Post event is triggered when the user has entered a value and pressed the post button.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.m.FeedInput.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.FeedInput with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.FeedInput.getMetadata()Returns a metadata object for class sap.m.FeedInput.
attachPost(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the post event of this sap.m.FeedInput.
detachPost(fnFunction, oListener)Detaches event handler fnFunction from the post event of this sap.m.FeedInput.
firePost(mArguments?)Fires event post to attached listeners.
getAriaLabelForPicture()Gets current value of property ariaLabelForPicture.
getButtonTooltip()Gets current value of property buttonTooltip.
getEnabled()Gets current value of property enabled.
getIcon()Gets current value of property icon.
getIconDensityAware()Gets current value of property iconDensityAware.
getMaxLength()Gets current value of property maxLength.
getPlaceholder()Gets current value of property placeholder.
getShowIcon()Gets current value of property showIcon.
getValue()Gets current value of property value.
setAriaLabelForPicture(sAriaLabelForPicture)Sets a new value for property ariaLabelForPicture.
setButtonTooltip(sButtonTooltip)Sets a new value for property buttonTooltip.
setEnabled(bEnabled)Sets a new value for property enabled.
setIcon(sIcon)Sets a new value for property icon.
setIconDensityAware(bIconDensityAware)Sets a new value for property iconDensityAware.
setMaxLength(iMaxLength)Sets a new value for property maxLength.
setPlaceholder(sPlaceholder)Sets a new value for property placeholder.
setShowIcon(bShowIcon)Sets a new value for property showIcon.
setValue(sValue)Sets a new value for property value.
Constructor Detail
new sap.m.FeedInput(sId?, mSettings?)
Constructor for a new FeedInput.

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:

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
post(oControlEvent)
The Post event is triggered when the user has entered a value and pressed the post button. After firing this event, the value is reset.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{string}oControlEvent.getParameters.value The value of the feed input before reseting it.
Method Detail
sap.m.FeedInput.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.FeedInput 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
sap.m.FeedInput.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.FeedInput.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
attachPost(oData?, fnFunction, oListener?): sap.m.FeedInput
Attaches event handler fnFunction to the post event of this sap.m.FeedInput.

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.FeedInput itself.

The Post event is triggered when the user has entered a value and pressed the post button. After firing this event, the value is reset.

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.FeedInput itself
Returns:
{sap.m.FeedInput} Reference to this in order to allow method chaining
detachPost(fnFunction, oListener): sap.m.FeedInput
Detaches event handler fnFunction from the post event of this sap.m.FeedInput.

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:
{sap.m.FeedInput} Reference to this in order to allow method chaining
firePost(mArguments?): sap.m.FeedInput
Fires event post to attached listeners.

Expects the following event parameters:

  • value of type stringThe value of the feed input before reseting it.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.m.FeedInput} Reference to this in order to allow method chaining
getAriaLabelForPicture(): string
Gets current value of property ariaLabelForPicture.

Text for Picture which will be read by screenreader. If a new ariaLabelForPicture is set, any previously set ariaLabelForPicture is deactivated.

Since:
1.30
Returns:
{string} Value of property ariaLabelForPicture
getButtonTooltip(): sap.ui.core.TooltipBase
Gets current value of property buttonTooltip.

Sets a new tooltip for Submit button. 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. The default value is set language dependent.

Default value is Submit.

Since:
1.28
Returns:
{sap.ui.core.TooltipBase} Value of property buttonTooltip
getEnabled(): boolean
Gets current value of property enabled.

Set this flag to "false" to disable both text input and post button.

Default value is true.

Returns:
{boolean} Value of property enabled
getIcon(): sap.ui.core.URI
Gets current value of property icon.

Icon to be displayed as a graphical element within the feed input. This can be an image or an icon from the icon font.

Returns:
{sap.ui.core.URI} Value of property icon
getIconDensityAware(): boolean
Gets current value of property iconDensityAware.

Some mobile devices support higher resolution images while others do not. Therefore, you should provide image resources for all relevant densities. If the property is set to "true", one or more requests are sent to the server to try and get the perfect density version of an image. If an image of a certain density is not available, the image control falls back to the default image, which should be provided.

If you do not have higher resolution images, you should set the property to "false" to avoid unnecessary round-trips.

Please be aware that this property is relevant only for images and not for icons.

Default value is true.

Returns:
{boolean} Value of property iconDensityAware
getMaxLength(): int
Gets current value of property maxLength.

The maximum length (the maximum number of characters) for the feed input's value. By default this is not limited.

Default value is 0.

Returns:
{int} Value of property maxLength
getPlaceholder(): string
Gets current value of property placeholder.

The placeholder text shown in the input area as long as the user has not entered any text value.

Default value is Post something here.

Returns:
{string} Value of property placeholder
getShowIcon(): boolean
Gets current value of property showIcon.

If set to "true" (default), icons will be displayed. In case no icon is provided the standard placeholder will be displayed. if set to "false" icons are hidden

Default value is true.

Returns:
{boolean} Value of property showIcon
getValue(): string
Gets current value of property value.

The text value of the feed input. As long as the user has not entered any text the post button is disabled

Returns:
{string} Value of property value
setAriaLabelForPicture(sAriaLabelForPicture): sap.m.FeedInput
Sets a new value for property ariaLabelForPicture.

Text for Picture which will be read by screenreader. If a new ariaLabelForPicture is set, any previously set ariaLabelForPicture is deactivated.

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
{string}sAriaLabelForPicture New value for property ariaLabelForPicture
Since:
1.30
Returns:
{sap.m.FeedInput} Reference to this in order to allow method chaining
setButtonTooltip(sButtonTooltip): sap.m.FeedInput
Sets a new value for property buttonTooltip.

Sets a new tooltip for Submit button. 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. The default value is set language dependent.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is Submit.

Parameters:
{sap.ui.core.TooltipBase}sButtonTooltip New value for property buttonTooltip
Since:
1.28
Returns:
{sap.m.FeedInput} Reference to this in order to allow method chaining
setEnabled(bEnabled): sap.m.FeedInput
Sets a new value for property enabled.

Set this flag to "false" to disable both text input and post button.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Parameters:
{boolean}bEnabled New value for property enabled
Returns:
{sap.m.FeedInput} Reference to this in order to allow method chaining
setIcon(sIcon): sap.m.FeedInput
Sets a new value for property icon.

Icon to be displayed as a graphical element within the feed input. This can be an image or an icon from the icon font.

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
{sap.ui.core.URI}sIcon New value for property icon
Returns:
{sap.m.FeedInput} Reference to this in order to allow method chaining
setIconDensityAware(bIconDensityAware): sap.m.FeedInput
Sets a new value for property iconDensityAware.

Some mobile devices support higher resolution images while others do not. Therefore, you should provide image resources for all relevant densities. If the property is set to "true", one or more requests are sent to the server to try and get the perfect density version of an image. If an image of a certain density is not available, the image control falls back to the default image, which should be provided.

If you do not have higher resolution images, you should set the property to "false" to avoid unnecessary round-trips.

Please be aware that this property is relevant only for images and not for icons.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Parameters:
{boolean}bIconDensityAware New value for property iconDensityAware
Returns:
{sap.m.FeedInput} Reference to this in order to allow method chaining
setMaxLength(iMaxLength): sap.m.FeedInput
Sets a new value for property maxLength.

The maximum length (the maximum number of characters) for the feed input's value. By default this is not limited.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 0.

Parameters:
{int}iMaxLength New value for property maxLength
Returns:
{sap.m.FeedInput} Reference to this in order to allow method chaining
setPlaceholder(sPlaceholder): sap.m.FeedInput
Sets a new value for property placeholder.

The placeholder text shown in the input area as long as the user has not entered any text value.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is Post something here.

Parameters:
{string}sPlaceholder New value for property placeholder
Returns:
{sap.m.FeedInput} Reference to this in order to allow method chaining
setShowIcon(bShowIcon): sap.m.FeedInput
Sets a new value for property showIcon.

If set to "true" (default), icons will be displayed. In case no icon is provided the standard placeholder will be displayed. if set to "false" icons are hidden

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Parameters:
{boolean}bShowIcon New value for property showIcon
Returns:
{sap.m.FeedInput} Reference to this in order to allow method chaining
setValue(sValue): sap.m.FeedInput
Sets a new value for property value.

The text value of the feed input. As long as the user has not entered any text the post button is disabled

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
{string}sValue New value for property value
Returns:
{sap.m.FeedInput} Reference to this in order to allow method chaining