A new option has been added to the FormView for configuring the Editor and Editor Set for a field at run-time. This will allow you to build mobile applications that, for example, present different Editors based on the user's device (a phone versus a tablet) or screen orientation (portrait versus landscape.)
The calculation for dynamically setting Editor Sets and Editors is done using javascript. The javascript can either be a function that you've created or in-line code written directly in the "Javascript code to specify Editor set/Editor" property. To set the Editor Set and Editor using javascript, select either the "Javascript Code" or "Javascript Function" option from the list of choices for the "Method for specifying Editor set/Editor" property. Your javascript calculation must return an array containing the name of the Editor Set and Editor to use. For example, if you wanted to use the Editor EDITOR_2 in the Editor Set EDITORSET_1 for a control, you would return an array containing 2 elements,'EDITORSET_1' and 'EDITOR_2':
Watch the video to learn more and check out the great resources at the end of this post for more information about Editor Sets and Editors.
Dynamically Setting the Editor and Editor Set Using Javascript
Video Link: https://www.viddler.com/v/c54e76a
Prerequisite Knowledge Base
If you're unfamiliar with Editors and Editor Sets or want to know more about them, check out these other discussions. They'll get you up to speed.
The Basics
Creating Editors
Other Types of Editors
Don't see what you need?
If something's missing, let us know! Post your questions in the forums or send an email to tabletbeta [at] alphasoftware.com.
The calculation for dynamically setting Editor Sets and Editors is done using javascript. The javascript can either be a function that you've created or in-line code written directly in the "Javascript code to specify Editor set/Editor" property. To set the Editor Set and Editor using javascript, select either the "Javascript Code" or "Javascript Function" option from the list of choices for the "Method for specifying Editor set/Editor" property. Your javascript calculation must return an array containing the name of the Editor Set and Editor to use. For example, if you wanted to use the Editor EDITOR_2 in the Editor Set EDITORSET_1 for a control, you would return an array containing 2 elements,'EDITORSET_1' and 'EDITOR_2':
Code:
var editor = ['EDITORSET_1','EDITOR_2']; return editor;
Dynamically Setting the Editor and Editor Set Using Javascript
Video Link: https://www.viddler.com/v/c54e76a
Prerequisite Knowledge Base
If you're unfamiliar with Editors and Editor Sets or want to know more about them, check out these other discussions. They'll get you up to speed.
The Basics
- Introduction to the FormView Control: A discussion about the FormView, Editors, and Editor Sets.
Creating Editors
- Editors: Using a Dropdown Box: A discussion about how to use a dropdown box as an editor
- Editors: Cascading Dropdown Boxes: A continuation of a previous thread, Editors: Using a Dropdown Box, which covers how to implement cascading dropdown boxes within the context of tablet form Editors and Editor Sets.
- Editors: Pre-Defined List Control Editor: Dropping in a list control for editing data is made easier with the Editor-List. Learn how to leverage this control in your mobile apps.
- Editors: Populating a List from a SQL Query: Lists can be populated from a variety of sources. Discover how the onDialogInitialize event can be used to cache data to populate a List control Editor.
- Editors: Cascading List Control: Learn how to create a cascading List control Editor.
- Introduction to Group Editors: Learn how to edit a group of controls together using a Group Editor.
Other Types of Editors
- Switch Editors: Discover how you can use an in-line switch to edit values instead of an editor set for binary and multi-value fields.
- FormView Image Capture: Learn how easy it is to capture images using the FormView control
Don't see what you need?
If something's missing, let us know! Post your questions in the forums or send an email to tabletbeta [at] alphasoftware.com.