Platform Specific Binding¶
Platform specific binding allow application to pass value depending on the device's platform. This allows app more flexibility and greater control in certain platform.
Indicator¶
-
The $ indicator could be applied to all properties value including string literal, binding, globals,
ActionBar
,ToolBar
,FormCell
controls,Sections
controls,Extension
controls. -
The key is
PLT
-
Consists of three parameters, first one for iOS, second one for Android, and third for Web.
-
It is advised to add single quote (\') for string literal within the indicator to mark the start and end of the string value, e.g. $(
PLT
,'string value for iOS','string value for Android','string value for Web'). -
The supported value types for parameter are string, integer, boolean, Resolvable value types.
-
Complex types (array and object) are not supported as parameter value.
-
If no value to be set on one of the platform parameter, please specify null
Description¶
Return the specified string according to platform
Usage¶
$(PLT, <value for iOS>, <value for Android>, <value for Web>)
Parameters:
Parameter Name | Type | Required? | Description |
---|---|---|---|
Value for iOS | String Literal, ResolvableValue |
Optional | Value for iOS |
Value for Android | String Literal, ResolvableValue |
Optional | Value for Android |
Value for Web | String Literal, ResolvableValue |
Optional | Value for Web |
Examples¶
$(PLT,'text to be displayed on iOS','text to be displayed on Android','text to be displayed on Web)
$(PLT,'$(L,work_order_id)','/AssetWorkManager/Globals/Test.global''/AssetWorkManager/Globals/Test2.global')
$(PLT,'#Page:CurrentPage/#View:OrderDesc/#Property:Text','/AssetWorkManager/Rules/Description.js','/AssetWorkManager/Rules/Rule.js')
$(PLT,123,456,789)
$(PLT,true,false,true)
$(PLT,null,'some text for Android',null)
$(PLT,'some text for iOS',null,'some text for Web)
$(PLT,'some text for iOS')
PLT
Formatter for Events ( Supported for Both Mobile and Web
)¶
- Platform specific binding is supported for the following events:
OnPress
OnAccessoryButtonPress
FormatRule
OnValueChange
- All the page level events except
OnActivityBackPressed
event supportPLT
.OnActivityBackPressed
is an Android platform specific event. - All the application level events.
OnSuccess
,OnFailure
andOnInvalid
events for an action.
- Events without override format are only supported in the current implementation.
OnPress
event:
"OnPress": "$(PLT, '/MDKDevApp/Actions/Messages/OnPressIOS.action', '/MDKDevApp/Actions/Messages/OnPressAndroid.action', '/MDKDevApp/Actions/Messages/OnPressWeb.action')"
OnAccessoryButtonPress
event:
"OnAccessoryButtonPress": "$(PLT,'/MDKDevApp/Actions/Messages/OnAccessoryButtonPressIOS.action', '/MDKDevApp/Actions/Messages/OnAccessoryButtonPressAndroid.action', '/MDKDevApp/Actions/Messages/OnAccessoryButtonPressWeb.action')"
FormatRule
event:
"FormatRule": "$(PLT,'/MDKDevApp/Rules/ConvertToUppercase.js','/MDKDevApp/Rules/ConvertToLowercase.js', '/MDKDevApp/Rules/ConvertToCamelcase.js')"
OnValueChange
event:
"OnValueChange": "$(PLT,'/MDKDevApp/Actions/Messages/OnValueChangeIOS.action', '/MDKDevApp/Actions/Messages/OnValueChangeAndroid.action', '/MDKDevApp/Actions/Messages/OnValueChangeWeb.action')"
Page level events:
-
"OnLoaded": "$(PLT,'/SEAMI18NTestApp/Actions/Messages/OnLoadedIOS.action', '/SEAMI18NTestApp/Actions/Messages/OnLoadedAndroid.action','/SEAMI18NTestApp/Actions/Messages/OnLoadedWeb.action')"
-
"OnUnloaded": "$(PLT,'/SEAMI18NTestApp/Actions/Messages/OnUnloadedIOS.action', '/SEAMI18NTestApp/Actions/Messages/OnUnloadedAndroid.action','/SEAMI18NTestApp/Actions/Messages/OnUnloadedWeb.action')"
Applications level events:
-
"OnLaunch": "$(PLT, '/MDKDevApp/Actions/PLTActions/AppEvents/OnLaunchIOS.action','/MDKDevApp/Actions/PLTActions/AppEvents/OnLaunchAndroid.action', '/MDKDevApp/Actions/PLTActions/AppEvents/OnLaunchWeb.action')"
-
"OnExit": "$(PLT, '/MDKDevApp/Actions/PLTActions/AppEvents/OnExitIOS.action','/MDKDevApp/Actions/PLTActions/AppEvents/OnExitAndroid.action')"
-
"OnResume": "$(PLT, '/MDKDevApp/Actions/PLTActions/AppEvents/OnResumeIOS.action','/MDKDevApp/Actions/PLTActions/AppEvents/OnResumeAndroid.action')"
-
"OnSuspend": "$(PLT, '/MDKDevApp/Actions/PLTActions/AppEvents/OnSuspendIOS.action','/MDKDevApp/Actions/PLTActions/AppEvents/OnSuspendAndroid.action')
OnSuccess, OnFailure and OnInvalid
events for an action:
-
"OnSuccess": "$(PLT,'/MDKDevApp/Actions/PLTActions/OnSuccessIOS.action', '/MDKDevApp/Actions/PLTActions/OnSuccessAndroid.action', '/MDKDevApp/Actions/PLTActions/OnSuccessWeb.action')"
-
"OnFailure": "$(PLT,'/MDKDevApp/Actions/PLTActions/OnFailureIOS.action', '/MDKDevApp/Actions/PLTActions/OnFailureAndroid.action', '/MDKDevApp/Actions/PLTActions/OnFailureWeb.action')"
-
"OnInvalid": "$(PLT,'/MDKDevApp/Actions/PLTActions/OnInvalidIOS.action', '/MDKDevApp/Actions/PLTActions/OnInvalidAndroid.action', '/MDKDevApp/Actions/PLTActions/OnInvalidWeb.action')"