WebTabSet Studio
your content here...
  Reset
JavaScript Callback:
This sample demonstrates how you can use client-side JavaScript to populate the WebTabSet children items.

To support this feature, WebTabSet uses the following client-side method:

function cwtsOnBeginRequest(controlId, requestPath)

This is a callback method that needs to be implemented by you. WebTabSet will automatically detect the presence of this method, and call it whenever data is needed for children items. The parameters are:
  • controlId - the control identifier of the WebTabSet instance.
  • requestPath - the path to the data required for the expanded item object.
If the data is available, it may be returned as a JSON string or JavaScript object. If the data needs to be fetched, return null and the data can be processed later by calling the following client-side method:

function cwtsProcessResponse(controlId, responseData)

This method is implemented in the WebTabSet library. The parameters are:
  • controlId - the control identifier of the WebTabSet instance.
  • responseData - the children item information as a JSON string or JavaScript object.
For demonstration purposes, the data for the root parent items are fetched immediately and all other children items simulate an asynchronous loading of the data.

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.
Control being used:
View the code:
The code is available in the samples directory under:
/DataRetrieval
    /JavaScriptCallback