JavaScript

{dialog.object}.refreshClientSideComputations Method

Syntax

{dialog.Object}.refreshClientSideComputations([flagSynchronous]);

Arguments

flagSynchronous

An optional true/false value indicating whether the refresh should be synchronous or asynchronous. Default value is false. See explanation below, Synchronous and Asynchronous Flag.

Description

Force all client-side computations (calculated fields, show/hide expression, enable expression, etc) to be recomputed.

 Discussion

Client-side calculations are also known as 'watch events'. In effect, this method forces all watch events to fire. Generally, this should not be necessary as the Dialog will automatically be recalculated when necessary. However, there may be situations where a watch event would not normally fire, but you want to force it to fire.

For example, say you have a watch event that is watching the value in a textbox control. The watch event will fire when the textbox control is blurred (i.e. loses focus). Suppose you want the event to fire after every keystroke, rather than having to wait until the control is blurred. You could use this method on the control's onKeyUp event to force the watch events to fire.

{dialog.Object}.refreshClientSideComputations();

 Synchronous and Asynchronous Flag

By default, this method executes asynchronously, and the refresh is delayed for 300ms. The reason for this behavior is to prevent multiple calls to this method within a very short time, which can degrade performance of a UX component (especially in the case where the UX has a lot of watch expressions or the UX is running on a mobile device - which will have a relatively slow processor compared with a desktop machine). If multiple calls to the method are made within a 300ms window, only the last call is executed - unless the calls are made with the flagSynchronous flag set to true.

See Also