Although AJAX greatly reduces the time it takes for data
to be loaded, there may be some wait time due to heavy traffic on the server.
You may want to provide visual feedback, such as an image or control that
appears and lets the user know the data is being retrieved. C1WebCommand2
provides a spinner that appears as the default image for the CallbackWaitImageURL,
CallbackWaitImageURL, and CallbackWaitImageURL
properties.
Use the CallbackWaitControlID property to show a control or use the CallbackWaitImageURL property to show an image while information is being retrieved from the server.
Using the CallbackWaitControlID Property
1. Add the C1WebTreeView, C1WebTabStrip, or C1WebTopicBar component to your form.
2. Enable the PopulateOnDemand property for the C1WebTreeViewItem, C1WebTabStripGroup, or C1WebTopicBarGroup.
3. Add a Label control to your form, then set its Text property to The items are updating, and then set its BackColor property to a color of your choice.
4. Select the C1WebTreeView, C1WebTabStrip, or C1WebTopicBar component and set the CallbackWaitControlID property to Label1 in the Properties window.
In this example, the PopulateOnDemand property is enabled. The Label1 control's Text property has been set to The items are updating which appears when a node is expanded. Also the default image for the CallbackWaitImageURL has been removed to avoid clutter.
Using the CallbackWaitImageURL Property
If you would like to show an image rather than a control during the callback for your C1WebTreeView, C1WebTabStrip, or C1WebTopicBar control, use the CallbackWaitImageURL, CallbackWaitImageURL, CallbackWaitImageURL property.
1. Create an Images folder in the directory where your project is located, and place the desired image within the folder.
2. Add the C1WebTreeView, C1WebTabStrip, or C1WebTopicBar component to your form.
3. Enable the PopulateOnDemand property for the C1WebTreeViewItem, C1WebTabStripGroup, or C1WebTopicBarGroup.
For more information about setting the PopulateOnDemand property at design time or run time see Using the PopulateOnDemand Property.
4. Open the Properties window for C1WebTreeView, C1WebTabStrip, or C1WebTopicBar, then click the ellipsis button next to theCallbackWaitImageURL property. The Select Image dialog box appears.
5. Select the Images folder in the left window under Project folders.
6. Select an image located in the Contents of folder list and then click OK. The image URL appears next to the CallbackWaitImageURL property.
In this example, the CallbackWaitImageURL property is set to show a timer image, which appears near the clicked item, when an item or group is expanded.
Note: If both the CallbackWaitControlID and CallbackWaitImageURL properties are set, CallbackWaitControlID takes precedence over the CallbackWaitImageURL, and only the control appears.
Send comments about this topic to ComponentOne. Copyright © ComponentOne LLC. All rights reserved. |