This article summarizes best practices for using Dynamic Select controls and the alternatives.
There are several ways to make population of drop-down lists faster:
- Using static drop-down lists
- Server-side caching of drop-down lists
- Browser caching of drop-down lists
- Deferred load
Choose option (a) if the contents of the drop-down list changes only rarely and is the same for all users. To implement this option, create a Local List on the Table Edit tab of the property rule. After the first runtime display of the Local List, the system creates a lookup list cache on disk, and no further database accesses are necessary.
When you choose option (b), the drop-down list is loaded from the database into server memory the first time it is needed. Subsequently, the list is retrieved from memory. The list can be stored in the user context, which makes it available only to the current requestor (all windows of the same browser session). A round trip from the browser to the server is necessary when option (c) is chosen.
Option (c) stores the drop-down list in the browser memory and thereby eliminates the need for repeated round trips to the server. The list is accessible for all Internet Explorer windows of the same browser session. This option can be combined with option (b).
(A) Static Lists
You can implement static drop-down lists through a local list, defined property (e.g., property Size would have local list S, M, L, XL as drop-down choices). The HTML for the screen is created using this property definition. Local lists in property definitions are shared by all Process Commander users.
(B) Server side caching
You can implement server-side caching on a per requestor basis (that is, once per Process Commander login session) or on a global basis.
Server-side caching can be implemented in concert with client side (browser) caching. If this is done, the Dynamic Select script first checks its browser cache for the content and only do the round trip to the server if no hit is found in the client side cache.
(C) Browser caching
Dynamic content is cached based on the value of the
DSSource attribute. Multiple Dynamic Selects with the same
DSSource attribute within one html window, or across multiple windows within the same browser session, reuse the cached content. (Dynamic content is shared across multiple Internet Explorer windows but not across multiple Internet Explorer invocations).
Because the dynamic content is stored in the browser, it cannot be shared across users who work on other workstations.
(D) Deferred load
DSLoadMode attribute determines the time at which the Dynamic Select control is loaded; it can be set to one of the following values:
Auto: the control is loaded when the HTML page is loaded;
Manual: The control is the target of another Dynamic Select and is therefore loaded only if the Dynamic Select it depends on changes its value;
OnDemand: The Dynamic Select control is loaded when the control receives the focus or the mouse hovers over it.
Set the value of
OnDemand to defers the execution of the Dynamic Select control, and so can eliminate unnecessary trips to the server.