
370
❘
CHAPTER 13 THE CLIENT OBJECT MODEL AND JQUERY
FIGURE 13-2
This code actually uses the new SharePoint dialog framework APIs to perform the page refresh.
Running the application now will display the site’s title in the text box and then set the site’s title
when you click the button. After the title is updated, the page refreshes to show the new site title.
This is a very simple example, but it clearly demonstrates a code pattern for using the Client Object
Model: Defi ne the objects to retrieve, load them on the query queue, execute them on the server, and
handle the callback. As you look at more complex examples in the next section, you will use this
pattern over and over again.
COMMON LIST OPERATIONS
Now that you have a good understanding of the fundamentals, let’s look at a few of the most
common tasks you will use the Client Object Model for: reading and writing SharePoint list data.
In this sample, you will add a Visual Web Part to the solution and add buttons to call the various
584644c13.indd 370584644c13.indd 370 10/27/10 11:44:34 AM10/27/10 11:44:34 AM