Data Properties
The state of the our components.
Components have state known as Data Properties.
Data Properties are defined by creating a data
structure on your component and assigning each property a default value.
Property names must be surrounded by single or double quotes.
JavaScript is a case-sensitive language and CFML isn't. To preserve the casing of your property names, you must surround them with quotes.
Data Properties are parsed by JavaScript and, therefore, can only store values that are JavaScript friendly: strings, numeric, arrays, structs, or booleans.
Data Properties are visible to JavaScript. You SHOULD NOT store sensitive data in them.
Initial Values
Data properties should be assigned a default value, even if it's just an empty string.
Using Data Properties
You can access Data Properties from within your component Actions like so.
You can also reference Data Properties within your component template using #propertyName#.
Resetting Data Properties
You can reset properties to their original value inside your Actions using reset().
You can reset individual or all Data Properties.
You also can reset all properties EXCEPT the properties you pass.
Last updated