How the Web DataWindow works

The first time a page that contains a WebDataWindowControl is requested, the following sequence of steps occurs:

  1. The page sends an HTTP Get request to the server.

  2. The DataWindow engine creates an internal instance of a DataStore and performs the following tasks:

    1. Sets the working DataWindow object based on LibraryList and DataWindowObject properties.

    2. Populates the Web DataWindow’s properties from the properties defined on the object in DataWindow Designer or the properties defined for the WebDataWindowControl in the Properties window (see “WebDataWindowControl properties”).

    3. Registers client JavaScript, including hidden context and action fields and postback script, using the Page class method.

    4. Sets the database transaction and calls the DataStore's Retrieve method to retrieve data.

    5. If requested, saves data to a cache.

    6. Renders the XML/HTML/XHTML in the control’s Render method.

    7. Outputs the resulting XHTML or HTML into the Page.

  3. The HTTP response returns the Page to the client-side browser.

  4. The user interacts with the page, usually triggering a postback to the server.

    Figure 9-2 illustrates the sequence of events after a first request.

Figure 9-2: WebDataWindowControl first request

The image illustrates the request described above.

When user interaction triggers a postback, the following sequence of steps occurs:

  1. The page sends an HTTP Post request to the server.

  2. The DataWindow engine creates an internal instance of a DataStore and performs the following tasks:

    1. Sets the working DataWindow object based on LibraryList and DataWindowObject properties.

    2. Populates the Web DataWindow’s properties from the properties defined on the object in DataWindow Designer or the properties defined for the WebDataWindowControl in the Properties window (see “WebDataWindowControl properties”).

    3. Registers client JavaScript, including hidden context and action fields and postback script, using the Page class method.

    4. Sets the database transaction and calls the DataStore's Retrieve method to retrieve data, or restores cached data.

    5. Retrieves postback data stored in the context and action hidden field and applies the context and action to the DataStore.

    6. If the action is a client method or integrated button, triggers the BeforePerformAction and AfterPerformAction server-side events, enabling you to trap errors.

    7. Renders the XML/HTML/XHTML in the control’s Render method.

    8. Outputs the resulting XHTML or HTML into the Page.

  3. The HTTP response returns the Page to the client-side browser.

  4. The user interacts with the page, usually triggering a postback to the server.

    Figure 9-3 illustrates the sequence of events after a postback.

Figure 9-3: WebDataWindowControl postback

The image shows the postback process described above