Data Controls
Description
Data Controls are controls used to create interfaces for manipulating and editing data from a data source (e.g. SQL database, web service, static data, etc.)
Discussion
A Data Control is an interface, such as a TextBox or DropdownBox, that can be used to display and/or edit data from a data source (database, web service, etc.) The control in the UX Component is either generated as an HTML input control or as a more complex control - such as the List control - that contains multiple elements (toolbars, buttons, a custom client-side layout, etc) that can be used to interact with the data.
Working with Data Controls in Javascript
Javascript can be written to interact with a Data Control programmatically. This is done by calling methods on the UX Component object, which is represented in your javascript code using the {dialog.object} placeholder object. The following methods can be used to interact with Data Controls (click the method name for additional information):
- UX Method
- Description
- getValue
Get the current value of the Data Control. Works with all Data Controls.
- setValue
Set the current value of the Data Control. Works with all Data Controls.
- setValueFrom
Sets the value in a target control with the value from a source control. This is the equivallent of calling getValue to get the value from one Data Control and then calling setValue to set the value in another Data Control. Works with all Data Controls.
- setControlDisplay
Show or hide the Data Control.
- setDisabled
Enable or disable the Data Control.
- setFocus
Set the focus to the Data Control.
- getPointer
Get a pointer to the DOM element for the Data Control.
- getControl
Get a Javascript object for the Data Control that can be used to perform more complex operations or access/manipulate the Data Control's settings. This method is only available for more complex controls, such as a Slider, Date Picker, Map, List, ViewBox, etc. Basic controls, such as a TextBox or Label, do not have Javascript objects.
The methods above are not limited to Data Controls. Other controls can also be manipulated by these methods, however not every control is supported by all methods. For example, controls that do not have a value, such as a Container, cannot be used with the getValue or setValue methods.
Alpha Anywhere's popup help for javascript functions includes access to menus and builders that can be used to help write javascript code. If you are unsure if a control can be used with a method, the popup help for some methods includes the ability to display a list of IDs for the supported controls available in the UX Component.
