This sample demonstrates how you can use the built-in Ajax ability of WebTabSet to populate the children items.
To use this feature, you can set the following WebTabSet property to the URL of a web service that can supply the necessary information:
WebTabSet1.DataRetrievalUrl = "http://www.coalesys.net/WebTabSet/Services/DemoService.asmx/GetTabData";
This sample uses an ASP.NET Web Service that implements that following C# method for this purpose:
[WebMethod]
public TabData GetTabData(string controlId, string requestPath)
The name of this method is specified in the URL above.
The parameters are:
- controlId - the control identifier of the WebTabSet instance.
- requestPath - the path to the data required for the expanded item object.
The web service defines a helper class "TabData" that is serialized to return the children item information in JSON format.
If the built-in Ajax encounters an error during the retrieval of information from the web service, it uses the following client-side method:
function cwtsOnDataRetrievalError(controlId, statusCode, statusText)
This callback method can be implemented by you to allow reporting of the error to your users.
WebTabSet will automatically detect the presence of this method, and call it whenever it has trouble fetching data from the web service.
The parameters are:
- controlId - the control identifier of the WebTabSet instance.
- statusCode - the status code returned when retrieving children item information.
- statusText - the status description returned when retrieving children item information.
Additionally, whenever WebTabSet starts/stops retrieving data for any of the possible data retrieval modes it calls the following client-side callback methods:
function cwtsOnDataRetrievalBegin(controlId)
function cwtsOnDataRetrievalEnd(controlId)
These callback methods are demonstrated here by displaying the "Loading..." or "Ready" message.
In this sample the WebTabSet is allowing you to select a datacenter server, organized by region, location and role.
Clicking the "Submit" button will display the full path for your selection below:
Click the "Reset" link to clear your selection.