Class: ToolbarControlProxy¶
ToolbarControlProxy is a developer-facing class that provides access to a toolbar control for application specific customizations.
Hierarchy¶
-
ToolbarControlProxy
Implements¶
Summary¶
Constructors¶
Properties¶
Accessors¶
Methods¶
- _clientAPIProps
- applyValidation
- base64StringToBinary
- callFunction
- clearValidation
- clearValidationOnValueChange
- count
- create
- createLinkSpecifierProxy
- dismissActivityIndicator
- downloadInProgressForPage
- downloadInProgressForReadLink
- evaluateTargetPath
- evaluateTargetPathForAPI
- executeAction
- formatBase64String
- formatCurrency
- formatDate
- formatDatetime
- formatNumber
- formatPercentage
- formatScientific
- formatTime
- getActionResult
- getAppEventData
- getBindingObject
- getCaption
- getCircularImage
- getClientData
- getDefinitionValue
- getGlobalDefinition
- getIconTextImage
- getLanguage
- getLogger
- getMobileServiceAppId
- getMobileServiceEndpointUrl
- getName
- getPageProxy
- getPasscodeSource
- getPendingDownload
- getReadLink
- getRegion
- getRegions
- getSAPPassportHeaderValue
- getSupportedLanguages
- getToolbarControls
- getType
- getValue
- getVersionInfo
- initializeLogger
- isContainer
- isCurrentPage
- isDemoMode
- isMediaLocal
- localizeText
- read
- redraw
- sendMobileServiceRequest
- sendRequest
- setApplicationIconBadgeNumber
- setEditable
- setLanguage
- setRegion
- setStyle
- setValidationProperty
- setValue
- setVisible
- showActivityIndicator
- updateProgressBanner
- Create
Constructors¶
constructor¶
+ new ToolbarControlProxy(context
: IContext): ToolbarControlProxy
Overrides ControlProxy.constructor
Parameters:
Name | Type |
---|---|
context |
IContext |
Returns: ToolbarControlProxy
Properties¶
Protected
_context¶
• _context: IContext
Inherited from ClientAPI._context
Protected
_control¶
• _control: any
Inherited from ControlProxy._control
Accessors¶
actionResults¶
• get actionResults(): any
Inherited from ClientAPI.actionResults
Access to the action results from the client data
Returns: any
binding¶
• get binding(): Object
Inherited from ClientAPI.binding
Access to the context's binding property
Returns: Object
currentPage¶
• get currentPage(): any
Inherited from ClientAPI.currentPage
Get the topmost page in the navigation stack
Returns: any
Methods¶
Protected
_clientAPIProps¶
▸ _clientAPIProps(): IClientAPIProps
Inherited from ClientAPI._clientAPIProps
Returns: IClientAPIProps
applyValidation¶
▸ applyValidation(): void
Implementation of IToolbarProxy
Inherited from ControlProxy.applyValidation
Applies the validation view, if it's supported for the given control
Returns: void
base64StringToBinary¶
▸ base64StringToBinary(base64
: string): Promise‹any›
Implementation of IToolbarProxy
Inherited from ClientAPI.base64StringToBinary
This method converts base64 string to binary data
Parameters:
Name | Type | Description |
---|---|---|
base64 |
string | base64 string |
Returns: Promise‹any›
a promise with a binary data once it is resolved
callFunction¶
▸ callFunction(serviceName
: string, oFunction
: object, headers?
: Object): Promise‹any›
Inherited from ClientAPI.callFunction
Invoke an OData function import. Returns a Promise which resolves to the result(if existing) of the operation
Parameters:
▪ serviceName: string
service name
▪ oFunction: object
function name
Name | Type |
---|---|
Name |
string |
Parameters? |
object |
▪Optional
headers: Object
optional -- request headers
Returns: Promise‹any›
returns a Promise which resolves to the result(if existing) of the operation
clearValidation¶
▸ clearValidation(): void
Implementation of IToolbarProxy
Inherited from ControlProxy.clearValidation
Hides the validaiton view. Shorter version of: clientAPI.setupValidationProperties('ValidationViewIsHidden', true).applyValidation();
Returns: void
clearValidationOnValueChange¶
▸ clearValidationOnValueChange(): void
Implementation of IToolbarProxy
Inherited from ControlProxy.clearValidationOnValueChange
Hides the validaiton view while changing value
Returns: void
count¶
▸ count(serviceName
: string, entitySet
: string, queryOptions?
: string, headers?
: Object, requestOptions?
: Object): Promise‹any›
Implementation of IToolbarProxy
Inherited from ClientAPI.count
Perform a count on an entity set.
Parameters:
Name | Type | Description |
---|---|---|
serviceName |
string | service name |
entitySet |
string | entityset name |
queryOptions? |
string | query options |
headers? |
Object | request headers |
requestOptions? |
Object | request options |
Returns: Promise‹any›
returns a Promise which resolves to the result of the operation
create¶
▸ create(serviceName
: string, entitySet
: string, properties
: object, createLinks
: ILinkSpecifierProxy[], headers?
: object, requestOptions?
: object): Promise‹any›
Inherited from ClientAPI.create
Perform an operation to create odata entity. Returns a Promise which resolves to the result of the operation.
Parameters:
▪ serviceName: string
service name
▪ entitySet: string
entityset name
▪ properties: object
an object to sotre the propterties object with key/value pair
Name | Type |
---|---|
key |
string |
value |
any |
▪ createLinks: ILinkSpecifierProxy[]
list of readlinks
▪Optional
headers: object
request headers
Name | Type |
---|---|
key |
string |
value |
any |
▪Optional
requestOptions: object
request options
Name | Type |
---|---|
key |
string |
value |
any |
Returns: Promise‹any›
createLinkSpecifierProxy¶
▸ createLinkSpecifierProxy(property
: string, entitySet
: string, queryOptions?
: string, readLink?
: string): ILinkSpecifierProxy
Implementation of IToolbarProxy
Inherited from ClientAPI.createLinkSpecifierProxy
Create LinkSpecifierProxy to be consumed by odata link action. one of queryOptions or readLink is required.
Parameters:
Name | Type | Description |
---|---|---|
property |
string | property name |
entitySet |
string | entityset name |
queryOptions? |
string | query options |
readLink? |
string | readlink name |
Returns: ILinkSpecifierProxy
dismissActivityIndicator¶
▸ dismissActivityIndicator(id?
: number): void
Implementation of IToolbarProxy
Inherited from ClientAPI.dismissActivityIndicator
Dismiss activity indicator
Parameters:
Name | Type | Description |
---|---|---|
id? |
number | The id of the activity indicator to be dismissed. If no id is provided, the top activity indicator will be dismissed. Using ids ensures that the right text will be shown at all times if multiple indicators can be displayed, for example due to chained actions. |
Returns: void
downloadInProgressForPage¶
▸ downloadInProgressForPage(page
: string): boolean
Implementation of IToolbarProxy
Inherited from ClientAPI.downloadInProgressForPage
Determine if a dowload is in progress for this page
Parameters:
Name | Type |
---|---|
page |
string |
Returns: boolean
downloadInProgressForReadLink¶
▸ downloadInProgressForReadLink(readLink
: string): boolean
Implementation of IToolbarProxy
Inherited from ClientAPI.downloadInProgressForReadLink
Determine if a dowload is in progress for this readLink
Parameters:
Name | Type |
---|---|
readLink |
string |
Returns: boolean
evaluateTargetPath¶
▸ evaluateTargetPath(path
: string): any
Implementation of IToolbarProxy
Inherited from ClientAPI.evaluateTargetPath
Evaluate the target path and return the value from the resulting context.
Parameters:
Name | Type | Description |
---|---|---|
path |
string | the target path to be evaluated |
Returns: any
the value from the resulting context. If an element is on the context, consider that the final value. Otherwise use binding.
evaluateTargetPathForAPI¶
▸ evaluateTargetPathForAPI(path
: string): IClientAPI
Implementation of IToolbarProxy
Inherited from ClientAPI.evaluateTargetPathForAPI
Evaluate the target path and return the ClientAPI instance which encapsulates the result
Parameters:
Name | Type | Description |
---|---|---|
path |
string | the target path to be evaluated. Cannot be undefined or empty |
Returns: IClientAPI
a ClientAPI instance holding the result of target path evaluation, which can vary from a simple string to a view representation.
executeAction¶
▸ executeAction(actionPath
: string): Promise‹IActionResult›
Implementation of IToolbarProxy
Inherited from ClientAPI.executeAction
Execute an action. To ensure that the application waits for the action to complete, you must return the Promise returned by this method as the result of the rule. Not doing this may cause the action binding and pressed item to be reset before the action completes.
Parameters:
Name | Type | Description |
---|---|---|
actionPath |
string | the action path |
Returns: Promise‹IActionResult›
formatBase64String¶
▸ formatBase64String(base64
: string, contentType
: string): string
Implementation of IToolbarProxy
Inherited from ClientAPI.formatBase64String
This method formats MDK base64 string with content type
Parameters:
Name | Type | Description |
---|---|---|
base64 |
string | base64 string |
contentType |
string | base64 content type like "image/jpeg", "application/pdf" |
Returns: string
formatted base64 string.
formatCurrency¶
▸ formatCurrency(value
: number, currencyCode
: string, customLocale?
: string, customOptions?
: any): string
Implementation of IToolbarProxy
Inherited from ClientAPI.formatCurrency
This method is to format number into currency display format according to selected locale
Parameters:
Name | Type | Description |
---|---|---|
value |
number | numeric value to be formatted into currency display format |
currencyCode |
string | currency code to format |
customLocale? |
string | custom locale to be used in formatting the value |
customOptions? |
any | custom options to be used in formatting the value. The available options are: minimumIntegerDigits: The number of integer digits allowed as output. Default is 1 (System default); minimumFractionDigits: The minimum number of digits after the decimal separator allowed as output. Default is 0 (System default); maximumFractionDigits: The maximum number of digits after the decimal separator allowed as output. The default is managed by system default based on currency code; useGrouping: Determines whether the display should show the group separator. The default is managed by system default based on currency code; Example: |
Returns: string
formatted number in currency display format
formatDate¶
▸ formatDate(date
: Date, customLocale?
: string, customTimeZone?
: string, customOptions?
: any): string
Implementation of IToolbarProxy
Inherited from ClientAPI.formatDate
This method is to format date object into locale Date string
Parameters:
Name | Type | Description |
---|---|---|
date |
Date | date value to be formatted into locale string. Accepted values are datetime object, datetime in UTC string, timestamp number, datetimeoffset string |
customLocale? |
string | custom locale to be used in formatting the value |
customTimeZone? |
string | custom time zone to be used in formatting the value, must be a valid time zone name e.g. UTC, GMT+8, Europe/Berlin |
customOptions? |
any | custom options (in JSON object format) for formatting the value. Currently, the supported key is 'format' with the following possible value: 'short','medium','long','full'. Default: medium |
Returns: string
formatted string
formatDatetime¶
▸ formatDatetime(date
: Date, customLocale?
: string, customTimeZone?
: string, customOptions?
: any): string
Implementation of IToolbarProxy
Inherited from ClientAPI.formatDatetime
This method is to format date object into locale DateTime string
Parameters:
Name | Type | Description |
---|---|---|
date |
Date | date value to be formatted into locale string. Accepted values are datetime object, datetime in UTC string, timestamp number, datetimeoffset string |
customLocale? |
string | custom locale to be used in formatting the value |
customTimeZone? |
string | custom time zone to be used in formatting the value. Must be a valid time zone name e.g. UTC, GMT+8, Europe/Berlin |
customOptions? |
any | custom options (in JSON object format) for formatting the value. Currently, the supported key is 'format' with the following possible value: 'short','medium','long','full'. Default: medium (date), short (time) |
Returns: string
formatted string
formatNumber¶
▸ formatNumber(value
: number, customLocale?
: string, customOptions?
: any): string
Implementation of IToolbarProxy
Inherited from ClientAPI.formatNumber
This method is to format number according to selected locale
Parameters:
Name | Type | Description |
---|---|---|
value |
number | numeric value to be displayed in format according to selected locale |
customLocale? |
string | custom locale to be used in formatting the value |
customOptions? |
any | custom options to be used in formatting the value. The available options are: minimumIntegerDigits: The number of integer digits allowed as output. Default is 1 (System default); minimumFractionDigits: The minimum number of digits after the decimal separator allowed as output. Default is 0 (System default); maximumFractionDigits: The maximum number of digits after the decimal separator allowed as output. Default is 2 (MDK default); useGrouping: Determines whether the display should show the group separator. Default is true (MDK default); Example: |
Returns: string
formatted number
formatPercentage¶
▸ formatPercentage(value
: number, customLocale?
: string, customOptions?
: any): string
Implementation of IToolbarProxy
Inherited from ClientAPI.formatPercentage
This method is to format number to into percent display format
Parameters:
Name | Type | Description |
---|---|---|
value |
number | numeric value to be formatted into percent display string |
customLocale? |
string | custom locale to be used in formatting the value |
customOptions? |
any | custom options to be used in formatting the value. The available options are: minimumIntegerDigits: The number of integer digits allowed as output. Default is 1 (System default); minimumFractionDigits: The minimum number of digits after the decimal separator allowed as output. Default is 0 (System default); maximumFractionDigits: The maximum number of digits after the decimal separator allowed as output. Default is 2 (MDK default); useGrouping: Determines whether the display should show the group separator. Default is true (MDK default); Example: |
Returns: string
formatted number in percentage
formatScientific¶
▸ formatScientific(value
: number, customLocale?
: string, customOptions?
: any): string
Implementation of IToolbarProxy
Inherited from ClientAPI.formatScientific
This method is to format scientific style number according to selected locale
Parameters:
Name | Type | Description |
---|---|---|
value |
number | numeric value to be displayed in scientific style according to selected locale |
customLocale? |
string | custom locale to be used in formatting the value |
customOptions? |
any | custom options to be used in formatting the value: The available options are: minimumIntegerDigits: The number of integer digits allowed as output. Default is 1 (System default); minimumFractionDigits: The minimum number of digits after the decimal separator allowed as output. Default is 0 (System default); maximumFractionDigits: The maximum number of digits after the decimal separator allowed as output. Default is 2 (MDK default); useGrouping: Determines whether the display should show the group separator. Default is true (MDK default); Example: |
Returns: string
formatted number
formatTime¶
▸ formatTime(date
: Date, customLocale?
: string, customTimeZone?
: string, customOptions?
: any): string
Implementation of IToolbarProxy
Inherited from ClientAPI.formatTime
This method is to format date object into locale Time string
Parameters:
Name | Type | Description |
---|---|---|
date |
Date | date value to be formatted into locale string. Accepted values are datetime object, datetime in UTC string, timestamp number, datetimeoffset string |
customLocale? |
string | custom locale to be used in formatting the value |
customTimeZone? |
string | custom time zone to be used in formatting the value. Must be a valid time zone name e.g. UTC, GMT+8, Europe/Berlin |
customOptions? |
any | custom options (in JSON object format) for formatting the value. Currently, the supported key is 'format' with the following possible value: 'short','medium','long','full'. Default: short |
Returns: string
formatted string
getActionResult¶
▸ getActionResult(key
: string): IActionResult
Implementation of IToolbarProxy
Inherited from ClientAPI.getActionResult
Get the action result stored under the unique key
Parameters:
Name | Type |
---|---|
key |
string |
Returns: IActionResult
getAppEventData¶
▸ getAppEventData(): any
Implementation of IToolbarProxy
Inherited from ClientAPI.getAppEventData
Get the data which provides additional information about an app event, such as an app launch or exit, if such an event just occurred.
Returns: any
getBindingObject¶
▸ getBindingObject(): Object
Implementation of IToolbarProxy
Inherited from ClientAPI.getBindingObject
Get the current context's binding object
deprecated
- use the new property getter
Returns: Object
getCaption¶
▸ getCaption(): string
Implementation of IToolbarProxy
Inherited from ControlProxy.getCaption
Returns: string
the caption of the contol
getCircularImage¶
▸ getCircularImage(base64EncodedImageStr
: string): string
Implementation of IToolbarProxy
Inherited from ClientAPI.getCircularImage
Converts a regular rectangular image into a circular one.
Parameters:
Name | Type | Description |
---|---|---|
base64EncodedImageStr |
string | The Base64 image string which is to be made circular |
Returns: string
A Base64 string of the circular image, this image will be in PNG format.
getClientData¶
▸ getClientData(): IClientData
Implementation of IToolbarProxy
Inherited from ClientAPI.getClientData
Get the client data object. This starts out as a plain JavaScript object, and can be modified to hold application state. Can only be accessed for IClientAPI instances associated with a UI element, because that guarantees that the data will last for the lifetime of that element.
Returns: IClientData
getDefinitionValue¶
▸ getDefinitionValue(target
: string): Promise‹any›
Implementation of IToolbarProxy
Inherited from ClientAPI.getDefinitionValue
Return the value for given definition.
Parameters:
Name | Type | Description |
---|---|---|
target |
string | : any valid definition like rule/action path/global path/binding/targetpath etc |
Returns: Promise‹any›
Promise resolution.
getGlobalDefinition¶
▸ getGlobalDefinition(globalPath
: string): any
Implementation of IToolbarProxy
Inherited from ClientAPI.getGlobalDefinition
Get the global definition for the specified path
Parameters:
Name | Type |
---|---|
globalPath |
string |
Returns: any
getIconTextImage¶
▸ getIconTextImage(iconText
: string, width
: number, height
: number, isCircular
: true, stylesJSON?
: string): string
Implementation of IToolbarProxy
Inherited from ClientAPI.getIconTextImage
Creates an Image out of text provided in the iconText parameter. A max of two letters can be displayed on the image.
Parameters:
Name | Type | Description |
---|---|---|
iconText |
string | Text that is to be used for generating the IconTextImage |
width |
number | Width of the image |
height |
number | Heght of the image |
isCircular |
true | Decides whether the image should be circular in shape |
stylesJSON? |
string | FontSize, FontColor and BackgroundColor can be given in a Json to style the IconTextImage |
Returns: string
a Base64 string of IconTextImage.
getLanguage¶
▸ getLanguage(): string
Implementation of IToolbarProxy
Inherited from ClientAPI.getLanguage
This method is to get current app language from app settings.
Returns: string
app language
getLogger¶
▸ getLogger(): LoggerManager
Implementation of IToolbarProxy
Inherited from ClientAPI.getLogger
Get the singleton instance of the LoggerManager. If it has not been initialized yet, it throws exception
Returns: LoggerManager
getMobileServiceAppId¶
▸ getMobileServiceAppId(): string
Implementation of IToolbarProxy
Inherited from ClientAPI.getMobileServiceAppId
This method is to get AppId used for application in SAP Mobile Services.
Returns: string
getMobileServiceEndpointUrl¶
▸ getMobileServiceEndpointUrl(): string
Implementation of IToolbarProxy
Inherited from ClientAPI.getMobileServiceEndpointUrl
This method is to get Endpoint Url of connection to application in SAP Mobile Services.
Returns: string
getName¶
▸ getName(): string
Implementation of IToolbarProxy
Inherited from ControlProxy.getName
Returns: string
the name of the contol
getPageProxy¶
▸ getPageProxy(): IPageProxy
Implementation of IToolbarProxy
Inherited from ControlProxy.getPageProxy
Returns: IPageProxy
the Page, which the control belongs to
getPasscodeSource¶
▸ getPasscodeSource(): number
Implementation of IToolbarProxy
Inherited from ClientAPI.getPasscodeSource
Return Passcode Source.
0 - no passcode or unknown, 1 - user, 2 - device(iOS Only) 3 - Device and User (Android Only) Note: Android must always have a passcode for biometrics hence value 3
Returns: number
getPendingDownload¶
▸ getPendingDownload(page
: string): any
Implementation of IToolbarProxy
Inherited from ClientAPI.getPendingDownload
This method delgates to the AppSettingsManager to determine if the current page has a pending download.
Parameters:
Name | Type | Description |
---|---|---|
page |
string | page object path |
Returns: any
returns a pending download for this page, which is a JSON action binding associated with the download. Otherwise undefined
getReadLink¶
▸ getReadLink(path
: string): string
Implementation of IToolbarProxy
Inherited from ClientAPI.getReadLink
get the current context's binding's read link if any. Undefined otherwise
Parameters:
Name | Type | Description |
---|---|---|
path |
string | target path into the binding |
Returns: string
getRegion¶
▸ getRegion(): string
Implementation of IToolbarProxy
Inherited from ClientAPI.getRegion
This method is to get current app region from app settings.
Returns: string
app region
getRegions¶
▸ getRegions(): Object
Implementation of IToolbarProxy
Inherited from ClientAPI.getRegions
This method is to get list of regions
Returns: Object
list of regions in key value pairs
getSAPPassportHeaderValue¶
▸ getSAPPassportHeaderValue(componentName
: string, action
: string, traceFlag
: string, componentType
: string, prevComponentName?
: string, userId?
: string): string
Implementation of IToolbarProxy
Inherited from ClientAPI.getSAPPassportHeaderValue
Get SAP Passport header value
Parameters:
Name | Type | Description |
---|---|---|
componentName |
string | Name of the initial component. Default to 'MDK' if empty or null. |
action |
string | Name of executed action. Default to 'HTTP_Request' if empty. |
traceFlag |
string | Trace configuration. Accepted values are: StatisticsOnly, SAPTraceLevel_SQL, SAPTraceLevel_Buffer, SAPTraceLevel_Enqueu, SAPTraceLevel_RFC, SAPTraceLevel_Permission, SAPTraceLevel_Free, SAPTraceLevel_CFunction, DSR_ABAP_Trace_Flag, SAPTraceLevel_ABAPCondens0, SAPTraceLevel_ABAPCondens1, DSR_SAT_Trace_Flag, ESP_WebService_Flag, HTTP, TRCLVL_None, TRCLVL_Low, TRCLVL_Medium, TRCLVL_High Default to 'TRCLVL_Low' if empty or null. |
componentType |
string | Type of initial component. Accepted values are: Undefined, Webas, J2EE, Trex, ICM, Gateway, CPIC, Browser, TraceLib, DotNet, Eclipse, PI_For_SAP_Sender, SCP_For_NonSAP_Sender, PI_For_NonSAP_Sender, SAP_Partner, SCP_Request_Or_Determination_Later_In_Processing, S4, SFSF, Ariba, Concur, Fieldglass, Callidus, BYD, IBP, Hybris, SMB_B1, Industry_Cloud, Leonardo, Customer_Checkout, CoPilot Default to 'Undefined' if empty or null. |
prevComponentName? |
string | Optional. Name of previous component. Default to initial component name if unspecified. |
userId? |
string | Optional. ID of user who is processing the request. Default to ' |
Returns: string
it returns a string of SAP Passport value to be used on request header. The header name to be used is "SAP-PASSPORT"
getSupportedLanguages¶
▸ getSupportedLanguages(): Object
Implementation of IToolbarProxy
Inherited from ClientAPI.getSupportedLanguages
This method is to get list of supported languages
Returns: Object
list of supported languages in key value pairs
getToolbarControls¶
▸ getToolbarControls(): IControlProxy[]
Implementation of IToolbarProxy
This method returns the top-level controls for this container
Returns: IControlProxy[]
The controls for this container
getType¶
▸ getType(): string
Implementation of IToolbarProxy
Inherited from ControlProxy.getType
Returns: string
the type of the contol
getValue¶
▸ getValue(): any
Implementation of IToolbarProxy
Inherited from ControlProxy.getValue
Returns: any
the value of the contol
getVersionInfo¶
▸ getVersionInfo(): Object
Implementation of IToolbarProxy
Inherited from ClientAPI.getVersionInfo
Get the versions of application, definitions, SDK & etc
Returns: Object
it returns an array of key/value pairs to represent the versions for different components. iOS app and Android app may have different components and versions.
iOS app may inlcude the following keys: "Application Version", "Definitions Version", "SAPMDC", "SAPCommon", "APFiori", "SAPFioriFlows", "SAPFoundation", "SAPOfflineOData", "SAPOData"
Android app may include the following keys: "Application Version", "Definitions Version", "MDKClient Version", "com.sap.cloud.android:foundation", "com.sap.cloud.android:onboarding", "com.sap.cloud.android:fiori", "com.sap.cloud.android:odata", "com.sap.cloud.android:offline-odata"
WebApp may include the following keys: "Definition Version", "WebClient Version", "@ui5/webcomponents Version", "ui5-webcomponents-mdk Version"
initializeLogger¶
▸ initializeLogger(fileName
: any, maxFileSize
: any): void
Inherited from ClientAPI.initializeLogger
Initializes the LoggerManager and adds the log file handlers
Parameters:
Name | Type | Default | Description |
---|---|---|---|
fileName |
any | undefined | Optional, File name of the local log file on the client device. If missing, default value is ClientLog.txt |
maxFileSize |
any | undefined | Optional, Max file size before rollover of the local log file on the client device. If missing, default value is 5MB |
Returns: void
isContainer¶
▸ isContainer(): boolean
Implementation of IToolbarProxy
Inherited from ControlProxy.isContainer
Determine if the control is a container control
Returns: boolean
returns true if the control is a container control. Otherwise, returns false. It always returns false for a simple control
isCurrentPage¶
▸ isCurrentPage(pageName
: string): boolean
Implementation of IToolbarProxy
Inherited from ClientAPI.isCurrentPage
Determine if the page is the topmost page in the navigation stack
Parameters:
Name | Type |
---|---|
pageName |
string |
Returns: boolean
isDemoMode¶
▸ isDemoMode(): Boolean
Implementation of IToolbarProxy
Inherited from ClientAPI.isDemoMode
Determine if it is in demo mode
Returns: Boolean
isMediaLocal¶
▸ isMediaLocal(serviceName
: string, entitySet
: string, readLink
: string): Promise‹boolean›
Implementation of IToolbarProxy
Inherited from ClientAPI.isMediaLocal
Get whether or not the media object for the supplied readLink exists and is local
Parameters:
Name | Type | Description |
---|---|---|
serviceName |
string | service name |
entitySet |
string | entityset name |
readLink |
string | readlnk name |
Returns: Promise‹boolean›
a promise with a boolean result once it is resolved
localizeText¶
▸ localizeText(key
: string, dynamicParams?
: string[]): string
Implementation of IToolbarProxy
Inherited from ClientAPI.localizeText
This method is to localize text
Parameters:
Name | Type | Description |
---|---|---|
key |
string | key of text to be localized |
dynamicParams? |
string[] | - |
Returns: string
localized text
read¶
▸ read(serviceName
: string, entitySet
: string, properties
: string[], queryOptions?
: string, headers?
: Object, requestOptions?
: Object): Promise‹any›
Implementation of IToolbarProxy
Perform a query on an entity set. Returns a Promise which resolves to the result of the operation
Parameters:
Name | Type | Description |
---|---|---|
serviceName |
string | service name |
entitySet |
string | entityset name |
properties |
string[] | list of properties to be read |
queryOptions? |
string | query optins |
headers? |
Object | request headers |
requestOptions? |
Object | request options |
Returns: Promise‹any›
returns a Promise which resolves to the result of the operation
redraw¶
▸ redraw(): void
Implementation of IToolbarProxy
Inherited from ControlProxy.redraw
Use this method to redraw the control. In cases where a control does not have redraw semantics the control's container will redraw
Returns: void
sendMobileServiceRequest¶
▸ sendMobileServiceRequest(path
: string, params?
: any): Promise‹any›
Implementation of IToolbarProxy
Inherited from ClientAPI.sendMobileServiceRequest
Send a request to application's SAP Mobile Services
deprecated
- use the new sendRequest API
Parameters:
Name | Type |
---|---|
path |
string |
params? |
any |
Returns: Promise‹any›
sendRequest¶
▸ sendRequest(path
: string, params?
: any): Promise‹any›
Implementation of IToolbarProxy
Inherited from ClientAPI.sendRequest
This method is to send a request to application's SAP Mobile Services.
- Example of the
params
parameter:
{ "method": "<string>", "header": { "<key1>": "<value as string>", "<key2>": "<and so on>", }, "body": "<string>" }
Parameters:
Name | Type | Description |
---|---|---|
path |
string | Relative path of request via application's SAP Mobile Services. |
params? |
any | Optional. An object consists of method , header , and body of request.Note: If params is not given, request is set as GET method by default. See description above for the example. method is string representing the HTTP Method to use. Supported value for methods are: GET, HEAD, POST, PUT, DELETE, PATCH, CONNECT, OPTIONS, and TRACE.header should be an object with key-value pairbody should be request body String, Binary, FormData, JSON object or Array. header . |
Returns: Promise‹any›
setApplicationIconBadgeNumber¶
▸ setApplicationIconBadgeNumber(badge
: number): void
Implementation of IToolbarProxy
Inherited from ClientAPI.setApplicationIconBadgeNumber
Set the application icon badge number Note: This function is for iOS only
Parameters:
Name | Type | Description |
---|---|---|
badge |
number | the number to set |
Returns: void
setEditable¶
▸ setEditable(value
: boolean): this
Implementation of IToolbarProxy
Inherited from ControlProxy.setEditable
Set the control's editable status
Parameters:
Name | Type | Description |
---|---|---|
value |
boolean | editable setting |
Returns: this
this - allows chaining
setLanguage¶
▸ setLanguage(languageKey
: string): void
Implementation of IToolbarProxy
Inherited from ClientAPI.setLanguage
This method is to set app language into app settings.
Parameters:
Name | Type | Description |
---|---|---|
languageKey |
string | language key |
Returns: void
setRegion¶
▸ setRegion(region
: string): void
Implementation of IToolbarProxy
Inherited from ClientAPI.setRegion
This method is to set app region into app settings.
Parameters:
Name | Type | Description |
---|---|---|
region |
string | region |
Returns: void
setStyle¶
▸ setStyle(styleClass
: string, subView
: string): this
Implementation of IToolbarProxy
Inherited from ControlProxy.setStyle
Apply styles to a control
Parameters:
Name | Type | Description |
---|---|---|
styleClass |
string | The name of the style class to be applied |
subView |
string | The name of the subview to apply the style to. If this is '', the style is applied to the entire control. |
Returns: this
setValidationProperty¶
▸ setValidationProperty(key
: string, value
: any): ControlProxy
Implementation of IToolbarProxy
Inherited from ControlProxy.setValidationProperty
Sets the validationProperties parameter of the underlying Observable. Currently only the FormCell Observable is supported.
This will not cause the UI to rerender. To redraw the form cell, use the applyValidation API.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | the key of the validaiton property Available keys: - SeparatorBackgroundColor (hex color as string e.g.: 'ffffff') - SeparatorIsHidden (boolean) - ValidationMessage (string) - ValidationMessageColor (hex color as string e.g.: 'ffffff') - ValidationViewBackgroundColor (hex color as string e.g.: 'ffffff') - ValidationViewIsHidden (boolean) |
value |
any | the value of the validation property |
Returns: ControlProxy
the current instance of the ControlProxy class
setValue¶
▸ setValue(value
: any, notify
: boolean): this
Implementation of IToolbarProxy
Inherited from ControlProxy.setValue
Set the value in the control
Parameters:
Name | Type | Default | Description |
---|---|---|---|
value |
any | - | value to be set |
notify |
boolean | true | whether to send the notification |
Returns: this
this - allows chaining
setVisible¶
▸ setVisible(value
: boolean, redraw
: boolean): this
Implementation of IToolbarProxy
Inherited from ControlProxy.setVisible
Sets the control's visible state with / without redraw
Parameters:
Name | Type | Default | Description |
---|---|---|---|
value |
boolean | - | visible state |
redraw |
boolean | true | true if redraw after set the visible state |
Returns: this
showActivityIndicator¶
▸ showActivityIndicator(text?
: string): number
Implementation of IToolbarProxy
Inherited from ClientAPI.showActivityIndicator
Show activity indicator with specified text
Parameters:
Name | Type | Description |
---|---|---|
text? |
string | The text to be shown |
Returns: number
The id which can be used to dismiss the activity indicator
updateProgressBanner¶
▸ updateProgressBanner(message
: string): void
Implementation of IToolbarProxy
Inherited from ClientAPI.updateProgressBanner
Update an existing progress banner with new text. If no progress banner action is in progress, no banner will be displayed.
Parameters:
Name | Type | Description |
---|---|---|
message |
string | The text to show on the progress banner |
Returns: void
Static
Create¶
▸ Create(context
: IContext): ClientAPI
Inherited from ClientAPI.Create
Create an instance of ClientAPI or its extended classes such as PageProxy, ControlProxy.
Parameters:
Name | Type | Description |
---|---|---|
context |
IContext | an object with IContext type to represent the UI element |
Returns: ClientAPI