The Company
Products
Solutions
Services and Support
Customers
Partners
News
Events
Home >> News >> WebFOCUS Newsletter >> Current Issue >> Please Wait for Maintain

Please Wait for Maintain

By Mark Derwin

When dealing with applications that manipulate large amounts of data, sometimes the user has to wait for a response. Displaying a "Please Wait" message may stop the user from clicking on the trigger multiple times.

Maintain easily gives you this ability. You can set it up so that the message pops up when the application performs an action and then it disappears when control is passed back to the user.

To accomplish this, start by creating a text object on your form. The size, color and font of the message can be whatever you want it to be. Make sure that you set the property Visible to 0 - No. We don't want the object displayed when the form is displayed. In addition, make sure you know the name of the object. We will need it in our trigger (see Screen 1).

Screen 1

Next we create a trigger to display the object and start the data processing. I created a click trigger from a button. Your trigger can be anything. The code behind the trigger should look like this:

function OnButton1_Click ( )  {
document.getElementById("Text1").style.visibility = 'visible';
IWCTrigger("get_data");
}

Since this code is JavaScript, make sure to click the J on top of the event handler box. In my example, the name of the object is Text1, and the case I am performing is get_data. Remember, case matters.

When the user presses the button, the "Please Wait" message is displayed via JavaScript, and control is passed to the case get_data in the Maintain procedure. When the get_data procedure is done, the form refreshes and the "Please Wait" message automatically disappears.

This example shows just how easy it is to use JavaScript to enhance Maintain applications.