Tag Info

Hot answers tagged

8

Are you talking about SP 2010? Then you can use either the REST API or you can use the Client Object Model.


6

You can use the ECMA Script Client Object Model: ExecuteOrDelayUntilScriptLoaded(loadWebs, "sp.js"); function loadWebs() { var clientContext = new SP.ClientContext.get_current(); this.webs = clientContext.get_web().get_webs(); clientContext.load(this.webs); clientContext.executeQueryAsync(Function.createDelegate(this, ...


6

Juergen, The below article should help: http://blog.collabware.com/2013/03/22/tips-tricks-sharepoint-2013-modal-dialogs/ You have SP.UI.ModalDialog.showWaitScreenWithNoClose which can be used.. function RequestEnded(sender, args) { try { waitDialog.close(); waitDialog = null; } catch (ex) { } }; function RequestStarted(sender, args) { ...


5

I was able to add a file with SP.RequestExecutor <%-- _lcid="1033" _version="15.0.4128" _dal="1" --%> <%-- _LocalBinding --%> <%@ Page language="C#" MasterPageFile="~masterurl/default.master" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=15.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" ...


5

SharePoint is a huge historical monster. Core of the current paging implementation was introduced long ago, probably in SP2010 or even earlier. That's why your approach doesn't work: SharePoint isn't finding some html elements that are supposed to be there, and falls back to a simpler approach with link. Investigation Here is why it happens (you may skip ...


4

jQuery is one way to do this (feels like everyones choice nowadays). Since you're using a Visual Web Part an ASP.NET Timer control in combination with an UpdatePanel might be a preferred choice in your case, that will also fix both your problems; delay load and refresh.


4

It's throwing the error because the <asp:ScriptManager> tag is most likely defined in your master page, causing two instances on the page you are trying to load. http://social.msdn.microsoft.com/Forums/br/sharepoint2010general/thread/54c271ee-de71-4e47-b02b-29a1d540b81c


4

You need to use the $expand option in your query string. siteUrl + "/_api/lists/getbytitle('" + listName + "')/items?$select=NameOfLookup/FieldYouWant&$expand=NameOfLookup/NameOfFieldYouWant" So yours would be: "/_api/lists/getbytitle('" + listName + "')/items?$select=$expand=status_x0028_test_x0029/Title&$expand=status_x0028_test_x0029/Title ...


4

Your issue is in understanding the async nature of JavaScript. The reason why there are no values is because you are attempting to access it before the executeQueryAsync function has returned and done it's job. Any logic that needs to access the values in globalTitle needs to be abstracted into a function or functions that can be invoked inside of the ...


3

I just did a test with SPServices where I set a Single line of text column to an empty string (""), which seemed to work just fine. This was with WSS 3.0 (the simplest test case, IMO). $().SPServices({ operation: "UpdateListItems", async: false, debug:true, listName: "Sales Opportunities", ID: 5, valuepairs: [["StateID", ""]], ...


3

I would recommend that your teams build all their products against version 3.5 of the .NET framework. If necessary you can map DLL versions in your web.config file using bindingRedirect to use the newer version of AJAX Extensions. You might need additional SafeControl entries if you have multiple versions.


3

The service needs to be AJAX enabled to generate a javascript proxy for you. Lists.asmx is not AJAX enabled. [WebServiceBinding(ConformsTo=WsiProfiles.BasicProfile1_1), WebService(Namespace="http://schemas.microsoft.com/sharepoint/soap/")] public class Lists : GenericService, ISoapServiceLists, ISoapServiceListData, ISoapServiceListSchema, ...


3

I've done ajax a few different ways. When deving webparts I usually try to use the ICallbackEventhandler (http://msdn.microsoft.com/en-us/library/system.web.ui.icallbackeventhandler.aspx), especially when creating webparts that need ajax. I've also had a scenario when I used an update panel ...


3

SharePoint works great with AJAX. Two of the great improvements for SharePoint 2010 was Client Side Object Model and REST interface which makes JavaScript development against SharePoint a lot easier that using the old Web Services. Another great option which makes a the Web Services usable and provides a lot of great functionality (and good documentation) ...


3

Since it is an intranet, I think worrying this much is a little over the top. I guess with fiddler around, anyone can modify their ajax response to the server, so I guess I'm not really following you about why an update panel is more secure than another implementation (such as icallbackeventhandler)? Are you counting on the postback security validation ...


3

Have a look at http://blog.jsonpify.com/ or, as suggested on the blog above, have a look at http://developer.yahoo.com/yql/ YQL can be called from client script using JSONP, allowing you to pass a SQL-ish query against an "Open Data Table". An Open Data Table is an abstraction layer similar to a BCS model in SharePoint. An Open Data Table abstracts web ...


3

See if these paths to the row count variables work: data.d.query.PrimaryQueryResult.RelevantResults.RowCount data.d.query.PrimaryQueryResult.RelevantResults.TotalRows If you have specific questions about the object model, I find that the best first point of reference is to look at the returned xml or json using web developer tools and looking at the ...


2

SPServices?


2

I'd suggest you start learning and using the Sharepoint 2010 Client OM (Client Object Model). You can read more about it here : http://blogs.technet.com/b/speschka/archive/2009/11/01/using-the-sharepoint-2010-client-object-model-part-1.aspx Also, if you write your asp.net code properly, you shouldn't have issues data being submitted again. One example of ...


2

I've ended up openning Visual Studio Command Prompt. Navigating to the bin/Release folder of my Web Part and use the sn -T command on my DLL to get the Token!


2

finally i figured out and below is the updated code: hope this will help others.. protected override void CreateChildControls() { if (!this._error) { try { base.CreateChildControls(); UpdatePanel updatePanel1 = new UpdatePanel(); ...


2

Dare i ask why you wouldn't just use SPServices (created by @sympmarc), an open source jQuery plugin that wraps methods in the OOTB SharePoint Web / WCF Services, making the use of these services in JavaScript as simple as the following example: $(document).ready(function() { $().SPServices({ operation: "GetListItems", async: false, listName: ...


2

I find it very hard to understand your exact criteria for setting the item in the SELECT box. But you should be able to accomplish this with JQuery in a HTML Form webpart. Here is a pseudo-code example. $(document).ready(function(){ //Criteria to determine the value to select. ...


2

I think the issue is that the options you are adding to the select don't have the same ids as the values in the source list. You're using the Title for both the option text and the value. Assuming that the DropDownChoice is a Lookup column, you need to use the right id for each option to match what would be saved if you weren't running your script.


2

The javaScript (and SilverLight) client object model doesn't implement clientContext.ExecuteQuery only the ExecuteQueryAsync(successDelegate, failDelegate)


2

I largely agree with Per on this one. (+1 Per) Loading JS from another server, especially when using HTTPS for SharePoint causes warnings in IE about loading unsecured/untrusted resources (I can't exactly remember the message). You can load JQuery (for example) from a CDN just fine but this is the problem we had when doing this. Also from memory, I think ...


2

On the security side UpdatePanel and pure AJAX are exactly the same. When posting using AJAX you can also check CurrentUser The differences between UpdatePanel and pure AJAX are: Ease of implementing. UpdatePanel is very easy. Pure AJAX requires more work Performance. UpdatePanel is doing a full page postback, just skipping some rendering parts. Pure AJAX ...


2

It is difficult to point out the exact reason for the issue. Here are som thougts which maybe can help you finding the solution: I have some posts about httphandlers in sharepoint on my blog, among them an answer on sharepoint.stackexchange: How to access a Web application/Farm level property bag via jQuery/Javascript/ClientContext Take a look on some ...



Only top voted, non community-wiki answers of a minimum length are eligible