Table of Contents

Article

Alternative ways to present users with a drop-down selection list

Summary

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:

  1. Using static drop-down lists
  2. Server-side caching of drop-down lists
  3. Browser caching of drop-down lists
  4. 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).



 

Suggested Approaches

(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

If the drop-down content is quasi-static, and so must be retrieved from a database table at run time, create a Dynamic Select control that utilizes server-side caching. The JavaScript function requires a round trip to the server to retrieve the content. A server side activity loads the content from the database only if it hasn’t been loaded before. Otherwise, it simply returns the cached content. 

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

Client-side caching is performed by the browser (Internet Explorer) and is therefore limited by the caching abilities and session context of Internet Explorer. Client side caching includes caching of http requests and caching of dynamic content. The Dynamic Select JavaScript caches its drop-down lists using dynamic content 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

The DSLoadMode attribute determines the time at which the Dynamic Select control is loaded; it can be set to one of the following values: Auto, Manual or OnDemand.

  • 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 DSLoadMode to Manual or OnDemand to defers the execution of the Dynamic Select control, and so can eliminate unnecessary trips to the server. 

Published January 23, 2006 — Updated November 15, 2015


0% found this useful

Have a question? Get answers now.

Visit the Pega Support Community to ask questions, engage in discussions, and help others.