This post is a very big help to the SharePoint 2010 developers. We need the intellisense help to write code fast in our SharePoint applications. But, in SP2010 BETA I faced so many problems to find what methods a java script object has. After written a long post on how to get the java script intellisense working in Visual Studio 2008 this is now an easy for me to do the same on Visual Studio 2010. I just tried the same implementation in VS 2010 and that worked great. So, there I started and started using it in ECMAScript development. When I first see the intellisense working in VS 2010 felt very very happy and jumped into the air. Because, before to find the same methods in the ECMAScript object, I had wasted hours and hours. One of the example is this post "How to know all methods in SP object".
Solution:
By using reference tag everything possible.
Showing posts with label ECMAScript. Show all posts
Showing posts with label ECMAScript. Show all posts
Wednesday, June 23, 2010
Friday, April 23, 2010
SharePoint 2010 ECMAScript Client Object Model - Samples and Examples
I have done sufficient experiments on SharePoint 2010 Client Object Model and other features while I am learning SharePoint 2010. Now, my work is to share the knowledge I have gained. So, part of that is all these examples and samples. I hope they will help you to better understand and keep you up to date with new technologies.
As we know SharePoint 2010 provides the nice API for 3 client object models, in this post I have concentrated on ECMAScript client object model.
Download the code from here and start see the code and try to learn it. All these examples are my own development and not copied from any where in the internet.
Download ECMAScript Client Object Model Samples and Examples.
Before take a look at the code, you should read the article for where to place the code and how to use.
ECMAScript - Complete details
As we know SharePoint 2010 provides the nice API for 3 client object models, in this post I have concentrated on ECMAScript client object model.
Download the code from here and start see the code and try to learn it. All these examples are my own development and not copied from any where in the internet.
Download ECMAScript Client Object Model Samples and Examples.
Before take a look at the code, you should read the article for where to place the code and how to use.
ECMAScript - Complete details
Friday, February 26, 2010
SharePoint 2010 ECMAScript - How to know logged in user information
This is post which is simple and not really needed. But when I started writing the code in ECMAScript I have faced problems in getting the logged in user information. So, my readers may feel good after see this post and really most the users are looking for this too.
By this time, we have really understood all about ECMAScript Client Object Model and debugging. So, it's easy for us to know it well.
Please find the code below to get the current user information.
By this time, we have really understood all about ECMAScript Client Object Model and debugging. So, it's easy for us to know it well.
Please find the code below to get the current user information.
<script type="text/javascript">
ExecuteOrDelayUntilScriptLoaded(getWebUserData, "sp.js");
var context = null;
var web = null;
var currentUser = null;
function getWebUserData() {
context = new SP.ClientContext.get_current();
web = context.get_web();
currentUser = web.get_currentUser();
currentUser.retrieve();
context.load(web);
context.executeQueryAsync(Function.createDelegate(this, this.onSuccessMethod), Function.createDelegate(this, this.onFailureMethod));
}
function onSuccessMethod(sender, args) {
var userObject = web.get_currentUser();
alert('User name:' + userObject.get_title() + '\n Login Name:' + userObject.get_loginName());
}
function onFailureMethod(sender, args) {
alert('request failed ' + args.get_message() + '\n' + args.get_stackTrace());
}
</script>
So, the above code returns you the user object and displays user name and user login name. You can customize it as you want and please let me know the feedback or questions you have.
SharePoint 2010 ECMAScript - how to know all methods in SP object and debug
After spent good time to write nice posts on Client Object Model and ECMAScript how to use, I want to present you another nice tip on how we know all the methods and properties available for the SP object in the ECMA javascript . MSDN documentation is not finalized or completed yet to know what properties and methods for SP objects have. And when you want to query something [like list or web] and you are not aware of what it has inside methods and properties, then the best way as far as I know is, using the Javascript debugging using Internet Explorer.
SharePoint 2010 - Client Object Model - ECMAScript - Introduction on how to use
In SharePoint 2010, the great feature is introducing the client object model [Read this article before proceed]. The great advantage with this is, we can do plenty of things without server side coding using the ECMAScript. There are plenty of default supported files to use and do whatever you want with the SP Package files. All javascript files will be found in the layouts folder. All of them starts with "SP" name.
ECMAScript works only for the current context. It means from outside of the site, you can't access the SharePoint data. This won't support the cross-site scripting.
How to add the reference to SP.js and access the data?
ECMAScript works only for the current context. It means from outside of the site, you can't access the SharePoint data. This won't support the cross-site scripting.
How to add the reference to SP.js and access the data?
Thursday, February 25, 2010
SharePoint 2010 - Complete details about Client Object Model
This is the introduction to the Client Object model introduced in the SharePoint 2010. This is going to be a huge help and useful part in SharePoint 2010 for developers and makes lot of customization to the existing SharePoint system.
In eariler versions, I mean till SharePoint 2007 the code runs using the SharePoint object model to run against the server which is running SharePoint. Other than the SharePoint server object model, other way is, simply reference the web service and use that to get and manipulate data. Then what is the need of SharePoint 2010 Client object model[Cleint OM] concept?
In eariler versions, I mean till SharePoint 2007 the code runs using the SharePoint object model to run against the server which is running SharePoint. Other than the SharePoint server object model, other way is, simply reference the web service and use that to get and manipulate data. Then what is the need of SharePoint 2010 Client object model[Cleint OM] concept?
Subscribe to:
Posts (Atom)