|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> function GetAnnouncements(){ var soapEnv = "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'> \ <soap:Body> \ <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \ <listName>Announcements</listName> \ <query><Query><Where><Eq><FieldRef Name='Title'/><Value Type='Text'>Test Announcement</Value></Eq></Where></Query></query> \ <viewFields> \ <ViewFields> \ <FieldRef Name='Title' /> \ <FieldRef Name='Body' /> \ <FieldRef Name='Expires' /> \ </ViewFields> \ </viewFields> \ <rowLimit>99999</rowLimit> \ <queryOptions xmlns:SOAPSDK9='http://schemas.microsoft.com/sharepoint/soap/' ><QueryOptions/> \ </queryOptions> \ </GetListItems> \ </soap:Body> \ </soap:Envelope>"; jQuery.ajax({ url: "/_vti_bin/lists.asmx", type: "POST", dataType: "xml", data: soapEnv, complete: ProcessListItems, contentType: "text/xml; charset=\"utf-8\"" }); } function ProcessListItems(xData, status) { jQuery(xData.responseXML).find("z\\:row").each(function () { alert($(this).attr("ows_Title")); $("<li>" + $(this).attr("ows_Title") + "</li>").appendTo("#Announcements"); }); } </script> <a href="#" onclick="Javascript:GetAnnouncements();">Get Announcements</a> <ul id="Announcements"></ul> |
Above is using an announcement list as example for how to retrieve items using Getlistitems with CAML query?
If you would like to know more details, please check at >>here<<
If you not able to found term store management link under site settings. You can run stsadm command under the SharePoint server which example provide below:-
STSADM -o activatefeature -id “73EF14B1-13A9-416b-A9B5-ECECA2B0604C” -url <Your Site URL Here> –force
Of course, you have alternative to enable the feature. You can use powershell and run the command below:-
Enable-SPFeature -identity “73EF14B1-13A9-416b-A9B5-ECECA2B0604C” -url <Your Site URL Here>
After run the command, you manage to see the link appear under the site settings.
Before you try to build news ticker in SharePoint, you need to download jQuery 1.7.2 version and SPServices 0.7.1a for plug into SharePoint Project.
This project will generate a custom SharePoint list and publish the information into SharePoint page by using SharePoint Web Part.
See >>Demo<<
Script below are retrieve SharePoint custom list and publish information, the information will be rotate in the page and able for user to click on the link to display an information via SharePoint Modal Dialog.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
<script type="text/javascript"> $(document).ready(function () { GetAnnoucements(); }); /* This function reads the data from annoucement list and passes the control to processResults method This makes and ajax call to lists.asmx web service. Make sure to replace {Site URL} with your SharePoint site url. */ var thissite = $().SPServices.SPGetCurrentSite(); function GetAnnoucements() { //Prepare the SOAP envelop for calling GetListItems method from lists.asmx web service var query = "<Query><Where><Gt><FieldRef Name='Expired'/><Value Type='DateTime'><Today/></Value></Gt></Where></Query>"; var camlViewField = "<ViewFields>"; camlViewField += "<FieldRef Name='ID' /><FieldRef Name='Title' /><FieldRef Name='Created' />"; camlViewField += "</ViewFields>"; $().SPServices({ operation: "GetListItems", webURL: thissite, async: true, listName: "NewsAnnouncements", CAMLViewFields: camlViewField, CAMLQuery: query, completefunc: processResult //debug mode // completefunc: function (xData, Status) { // var out = $().SPServices.SPDebugXMLHttpResult({ // node: xData.responseXML // }); // document.write(out); // } }); } /* This method parses the resultant xml and prepares the display. Please replace {Site Url} with your sharepont site url. */ function processResult(xData, status) { //Select the root element. //$("#s4-titleTextAnnouncementUl > li").remove(); var newnews = $("#s4-titleTextAnnouncementUl"); var rows; //Check if query returns no rows if (xData.responseXML.getElementsByTagName("z:row").length == 0) { //Prepare the display for 0 rows. var url = thissite + "/Lists/NewsAnnouncements/"; var head = "<li><div class='thumbnail'></div>"; var body = "<div class='info'>No news items<a href=" + url + "> Read all</a> <span class='cat'> no items found</span></div>"; var tail = "<div class='clear'></div></li>"; var liHtml = head + body + tail; //Append the HTML element to newNews element newnews.append(liHtml); } else { //Read all the rows from responseXml rows = xData.responseXML.getElementsByTagName("z:row"); jQuery(rows).each(function () { //Read the information from returned rows var url = thissite + "/Lists/NewsAnnouncements/DispForm.aspx?ID=" + $(this).attr("ows_ID"); var title = $(this).attr("ows_Title"); var created = $(this).attr("ows_Created"); var id = $(this).attr("ows_ID"); //Prepare the div element var head = "<li>"; var body = "<div class='info'><a href=\"#\" onclick=\"OpenAnnDialog(" + id + ");\">" + title + "</a></div><div class='thumbnail'></div>"; var tail = "<div class='clear'></div></li>"; var liHtml = head + body + tail; //Append the resultant element onto newNews element newnews.append(liHtml); }); } //Append entire newNews element to root Div newnews.appendTo("#s4-titleTextAnnouncement"); //Prepare the Carousel of all the returned items $("#s4-titleTextAnnouncement").jCarouselLite({ hoverPause: true, visible: 1, auto: 1500, speed: 5000 }); } /*This method to display modal popout function*/ function OpenAnnDialog(id) { var options = { url: thissite + "/Lists/NewsAnnouncements/DispForm.aspx?ID=" + id, title: "Announcements", width: 700, height: 500, dialogReturnValueCallback: DialogAnnouncementCallback }; SP.UI.ModalDialog.showModalDialog(options); } function DialogAnnouncementCallback(dialogResult, returnValue) { } </script> |
Paste code below to your page or you can place it at content editor. So that data can be display into the line.
|
1 2 3 4 |
<div id="s4-titleTextAnnouncement"> <ul id="s4-titleTextAnnouncementUl"> </ul> </div> |
If you would like to try it up, you can refer and download below resource:-
>>Download<<
This project is created by using Sandboxed Solution.
You can refer more sample from >>Here<<
Lots of new information by Microsoft about the next version of SharePoint. Check it out.
Credit to: http://tremblayse.wordpress.com/2012/07/16/sharepoint-2013-technical-preview-available-5/
I have this issue right after i’ve created a silverlight project. The silverlight designer is showing error like below:
An Unhandled Exception has occured
Click here to reload the designer
Details:
System.NullReferenceException Object reference not set to an instance of an object. at Microsoft.Windows.Design.Platform.SilverlightMetadataContext.SilverlightXamlExtensionImplementations.d__8.MoveNext() at MS.Internal.Design.Metadata.ReflectionProjectNode.BuildSubsumption() at MS.Internal.Design.Metadata.ReflectionProjectNode.SubsumingNamespace(Identifier identifier) at MS.Internal.Design.Markup.XmlElement.BuildScope(PrefixScope parentScope, IParseContext context) at MS.Internal.Design.Markup.XmlElement.ConvertToXaml(XamlElement parent, PrefixScope parentScope, IParseContext context, IMarkupSourceProvider provider) at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.FullParse(Boolean convertToXamlWithErrors) at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.get_RootItem() at Microsoft.Windows.Design.DocumentModel.Trees.ModifiableDocumentTree.get_ModifiableRootItem() at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.get_LoadState() at MS.Internal.Host.PersistenceSubsystem.Load() at MS.Internal.Host.Designer.Load() at MS.Internal.Designer.VSDesigner.Load() at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load() at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load(IsolatedView view) at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view) at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view) at MS.Internal.Host.Isolation.IsolatedDesigner.Load() at MS.Internal.Designer.DesignerPane.LoadDesignerView()
Well, even with this error, i can still use XAML to add controls, panel etc, and i am still able to build the solution and view output when i run it. But this is quite unconvenient as i could not see the design instantly via designer view, and also could not drag & drop controls into the designer window.
After some research, i found that the issue is because i had Silverlight SDK 3 and 4, together with Silverlight version 5.
So i uninstalled Silverlight 5 (via add remove program), and reinstalled Silverlight version 4 (using this link: http://go.microsoft.com/fwlink/?LinkId=146060) and ….
Phew! i can now view the Silverlight designer without error
Recently, I am using quite often to write jQuery, Javascript and SharePoint Client OM for my project. I found that default visual studio does not provide enough intellisense for jQuery, and Client OM. Therefore, I do some research and found out how to enable it.
To enable it, developer required to do some manual steps. This article is to help developer how to enable intellisense in visual studio 2008/2010.
Enable jQuery Intellisense
Before proceed to enable jQuery intellisense, visual studio 2008/2010 needs a special jquery library which is ‘vsdoc’ file provides the jQuery documentation. This can be download from official jQuery site, >>Click here<<.
Intellisense in .js file
In javascript file, use the reference tag add in the header and pointing to vsdoc file. Refer to below code:-
|
1 |
/// <reference path="jquery-1.7.2-vsdoc.js" /> |
Intellisene in aspx/ascx
If in aspx or ascx page, add below references for intellisense at the header of aspx/ascs
|
1 |
<script type="text/javascript" src="jquery-1.7.2-vsdoc.js"></script> |
Enable Client OM Intellisense
For enable client OM intellisense, same method apply from the steps above, just that pointing to different library.
in .js file
|
1 2 |
/// <reference path="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\MicrosoftAjax.js" /> /// <reference path="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\SP.debug.js" /> |
in aspx/ascx file
|
1 2 |
<script type="text/javascript" src="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\MicrosoftAjax.js" ></script> <script type="text/javascript" src="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\SP.debug.js" ></script> |
Enjoy coding!!!
I have this error while trying to create my first Silverlight project. I’m using Windows 7 and Visual Studio 2010 Ultimate (64 bit).
There is a popup from visual studio to ask me to download the runtime at http://go.microsoft.com/fwlink/?LinkId=146060
But it is not working. There is another error saying that this version is older that the one i have.
After some searching, i found this latest installer (link below) that installed the latest Silverlight 5 for developer (64 bit), and it solved my problem. I can now create/open Silverlight projects ~
http://go.microsoft.com/fwlink/?LinkID=229324
Add QueryString at end of the URL. Such like
|
1 |
AllItems.aspx?FilterField1=<ColumnName>&FilterValue1=<ColumnValue> |
This method is simple and easy to do filtering for SharePoint Custom list. Especially when you have a lookup field from custom list via redirect from one list to another list.
What you need to do is follow the steps below to try again the debugging mode