SharePoint 2010 have lot of news service but there is one i realy like the “Client Object Model” used to make Call to SharePoint Content and in particular the ECMAScript supported by SP.JS file.
This Client Object Model is very useful when you want to make use SharePoint content without using Visual Studio.
The best of all this Microsoft use almost the same name definition for the class, if you normally work with SharePoint Server SDK API you will see the development don't change to much.
Ok Let Start creating our Google search Web Part with Modal Dialog.
- Edit the Page on your sharepoint 2010 Page and add new Web Part option “HTML Form Web Part”
- Edit Source Editor and add the following code
Here is the Code:
options.url="http://www.google.com/search?h1=pt-PT&Source=hp&q=" + document.getElementById('PesquisaGoogle').value;
options.dialogReturnValueCallback= Function.createDelegate(null, CloseCallback);
function CloseCallback(result, target)
if (result == SP.UI.DialogResult.OK)
alert('Error on model dialog');
next steps input Google Search
<input type="text" id="PesquisaGoogle" name="firstname" />
<input type="button" value="Go" onclick="opendialog()" />
And here is the final Result, voila very easy.
Modal Dialog is a very usefull tool for sharepoint for acessibility reasons, will help you turn SharePoint more easy to final users.
Hope you like this litle article.