LoadOnDemandPanel
You use the LoadOnDemandPanel control to load and render an item. The item is not loaded and rendered until you call the load member function.
The LoadOnDemandPanel control provides a number of triggers you can listen for in your code:
-
beforeSendThe control raises this event before it makes an Ajax request. You can catch this event and write code that modifies the XMLHttpRequest object and sets additional headers, if you need to.
-
successThe control raises this event if the Ajax request was successful (that is, the control did not receive errors from the server, and it did not detect errors in the data).
-
errorThe control raises this event if the Ajax request did not succeed.
successanderrorare mutually exclusive. -
completeThe control always raises this event, for both successful and for failed requests and even for synchronous requests.
You use the LoadOnDemandPanel control to make SPEAK not load an item immediately. You can tell SPEAK to load the item in code. For example, you can tell SPEAK to load the item when a specific condition is met. You can also tell SPEAK to refresh (reload) an item it has previously loaded.
Properties
|
Name |
Description |
Default |
Availability |
|---|---|---|---|
|
Appearance | |||
|
ItemId |
Point to the item you want the control to load. |
Client, Server | |
|
Database |
Specify the database the control loads the item from. You can use the |
Client, Server | |
|
TriggerLoad |
You use this property to set the client-side event from the server. |
Server | |
|
IsLoaded |
This read-only property is true when the control has loaded the item. |
Client(read-only), Server | |
|
LoadOnVisible |
If this property is true, the control loads content when the IsVisible property is true. |
False |
Server |
View members – client-side events
View members represent events that the component either raises or listens to. You can listen for and raise events in the PageCode.
|
Name |
Description |
|---|---|
|
beforeSend |
The control raises this event before it makes an Ajax request. |
|
success |
The control raises this event when it has made a successful request. |
|
error |
The control raises this event if it has received an error as response to a request. |
|
complete |
This event is called regardless of whether the request was successful or not. You will always receive a complete callback, even for synchronous requests. |
Client-side methods
Client-side methods represent the list of methods exposed by control.
|
Name |
Description |
|---|---|
|
load |
This method loads the content and sets the isLoaded property to true. If the content is already loaded, it will do nothing. |
|
destroy |
This method destroys the panel and all nested controls. |
|
refresh |
This method resets the isLoaded property and the call load method. |