Quantcast
Channel: Framework for loading SharePoint web parts asynchronously
Viewing all articles
Browse latest Browse all 21

Updated Wiki: Documentation

$
0
0
What is required?

A web part that utilizes the Asynchronous Web Part framework should consist of the below components:
  •  A Web Part control class that serves as a wrapper for collecting properties, connections
  •  A Web Part UI control class that is responsible for rendering HTML for the web part
    • This control contains all the web part logic
  •  A Web Service that loads the web part UI control and renders its HTML back to the web part
  •  A JavaScript file that defines handlers for interaction between the web part and web service
How does it work?

  1. The web part control acts as a wrapper for collecting properties from either the web part properties pane or editor part and for connections with other web parts.
  2. When the web part loads first, the content container in the web part is loaded with a spinner and the JavaScript handler is registered with the page
  3. The JavaScript method then sends the web part properties and connection data to the web service
  4. The web service loads the web part UI control with the web part properties / connection details
  5. Web Part is then rendered as html
  6. If caching is required to be applied, the control HTML is stored in cache
  7. The result HTML is then loaded into the web part content container



The AsyncWebPart.cs class which acts as the web part wrapper calls the JavaScript method "AsyncWebPartGetData" with all the web part parameters / connection data

The JavaScript method "AsyncWebPartGetData" calls the web service method "GetUIHtml" from web service "AsyncWebPartService" with all the parameters

The Web Service method "GetUIHtml" loads the AsyncWebPartUI class which performs the actual core functionality of the web part.

This method renders the "AsyncWebPartUI" as Html.

The AsyncWebPartUI class performs the actual core functionality of the web part.


Viewing all articles
Browse latest Browse all 21

Trending Articles