Skip to main content
Sympraxis Consulting

Demos

Go Search
Home
Services
Clients
About
Contact
  

Sympraxis Consulting > Demos > Demo Pages > ListsWebServiceUpdate

 Sales Opportunities

TitleLead SourcePotential ValueAdjust
Ben's Web ShackNewspaper Advertising$542.00
Come visit www.sharepointdesigners.netPersonal Referral$529.00
Me New ZealandWeb Site$529.00
Markup director aide de campeWeb Site$529.00
Excelente FuncionalidadNewspaper Advertising$235.00
Jewelry by Irina Web Site$209.00
Rosslyn, VA Demo User -- Checking out cascading dropdownsNewspaper Advertising$149.00
Big Whoppin Humongous Deal!Personal Referral$103.00
Come visit SharePointDevWiki.comWeb Site$58.11
testNewspaper Advertising$2.00
test01Newspaper Advertising$0.00
test02Web Site$0.00
gnWeb Site$0.00
fdgPersonal Referral$0.00
hkjkPersonal Referral$0.00
Mon Jul 26 2010 20:12:46 GMT-0400 (Eastern Daylight Time)Newspaper Advertising-$434.00
 

 Lists Web Service Update Page Overview

NOTE: We've built a robust jQuery library for SharePoint Web Services which provides easy access to the SharePoint Web Services, like the UpdateListItems operation shown here.  It's available on Codeplex.

 

This page shows how you can use SharePoint's Lists Web Service and jQuery to update items in real time, without a roundtrip to the server.  It's based on a great blog post by Mike Oryszak.

Because this demo uses Web Services, anonymous access will not work.  When you are prompted for credentials, use these:
Username: demouser
Password: demouser
(As in "Demo User" -- nothing to do with rodents.)

Each row in the Data View Web part has buttons which allow you to increase/decrease the Potential Value column by either $1 or $10.  On each button click, there is a SOAP call to the Lists Web Service (_vti_bin/Lists.asmx, UpdateListItems operation) which updates the item.  The jQuery code then updates the value on the page and changes the fontStyle to italic.

After some DMs back and forth with Mike, at his suggestion (and for extra fun), we used the Tablesorter 2.0 jQuery library so that the table re-sorts after each Potential Value change. A bonus effect of this is that the column headers are sortable as well.  The rudimentary styling on the headers shows this.

A known issue (which we chose not to deal with here) is that concurrent changes will write over each other.  There is no checking for these conditions, though they could be managed fairly easily.

Make some changes to the amounts in the Potential Values column by clicking the buttons (changed amounts will display in italics) and then refresh the page to see that the changes have been saved.