MashZone NextGen 10.2 | Appendix | Legacy Presto components | Apps and Workspaces | Custom Apps | Create Fully Custom Apps in the App Editor | Declare, Get and Set Properties in Custom Apps
 
Declare, Get and Set Properties in Custom Apps
 
Get Properties or Property Values
Set Property Values
In addition to the standard properties of all apps, such as width or title, any app can define additional properties in the <properties> section of its App Specification. For example:
...
<properties>
<property name="customer" datatype="string"/>
<property name="custNo" datatype="number" label="Customer Number"
isinput="true" required="true"/>
<property name="appID" datatype="string"
defaultvalue="akZR92Yng345ty" isinput="false" visibility="hidden"/>
</properties>
...
For details on the syntax to declare properties, see the <properties> or <property> topic.
Additional app properties most commonly represent input parameters for the app. But you can use properties to track any characteristic of an app that you need to save to or retrieve from an app.
App properties must have a name and a simple datatype such as string or number. Property names must be valid JavaScript names and cannot begin with presto (this namespace is reserved).
Note: Properties can be complex objects only when they are used to define the message payload for topics that an app publishes or subscribes to. See Wiring App Interactions for more information on topics and inter-app communication.
In addition, properties have several optional attributes that you can use, such as defaultvalue, required or tooltip. Most of these optional attributes are used in MashZone NextGen when users edit app properties. For example, the label attribute is the property name that users see when they update app properties in Mashboard or the AppDepot.
These optional attributes generally do not affect how the app runs. For example, the App Framework does not check to make sure that required properties have values when an app is first constructed.
Custom apps can access any of the attributes of a property and can use this information to implement specific behavior in the app. Custom apps can also set or get property values using the .MashZone NextGenApp API.

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release