Click here to Skip to main content
14,335,049 members

SharePoint

 
QuestionError in Web Part Errors and Form Authentication Disable Pin
Peace4all31-Dec-14 18:56
memberPeace4all31-Dec-14 18:56 
AnswerRe: Error in Web Part Errors and Form Authentication Disable Pin
Krishna Murthy G24-Mar-15 1:52
professionalKrishna Murthy G24-Mar-15 1:52 
QuestionDocument Library error - The security validation for this page is invalid Pin
Gautam15-Dec-14 3:32
memberGautam15-Dec-14 3:32 
QuestionRe: Document Library error - The security validation for this page is invalid Pin
Pradip R16-Dec-14 3:41
memberPradip R16-Dec-14 3:41 
SuggestionRe: Document Library error - The security validation for this page is invalid Pin
Gautam18-Dec-14 22:42
memberGautam18-Dec-14 22:42 
QuestionSharePoint 2013 web service Pin
dcof10-Dec-14 3:49
memberdcof10-Dec-14 3:49 
AnswerRe: SharePoint 2013 web service Pin
Ingo17-Mar-15 22:55
memberIngo17-Mar-15 22:55 
QuestionLync presence in SharePoint app part Pin
Member 1124629326-Nov-14 3:46
memberMember 1124629326-Nov-14 3:46 
Hi all,

I am creating an app part (SharePoint online) where I want to list users while showing their Lync presence. I am retrieving users from a list using CSOM.

I found this resource on how to integrate Lync presence: http://www.sharepointcolumn.com/lync-presence-indicators-code-snippets-in-sharepoint-2013/ (I am using DefaultRender).

It works perfectly when used as static HTML but I can't get it to work for the list items. I have tried appending html to the div and using Knockout.js.

I am using unique ID's for each control as stated in the comments. When I use the exact same html by manually entering sip and id instead of data-bind it works perfectly. But with knockout, it just does not seem to work. sip and id seems correct as far as I can tell.

Perhaps there is a better way of achieve Lync presence?

Here is the JavaScript:
 var ParticipantItem = function (name, sip, id, id2) {
    var self = this;
    self.Name = name;
    self.Sip = sip;
    self.Id = id;
    self.Id2 = id2;
}
 
function ParticipantListViewModel() {
    var self = this;
    self.Participants = ko.observableArray();
  
    self.AddParticipant = function (name, sip, id, id2) {
        self.Participants.push(new ParticipantItem(name, sip, id, id2));
        nbrOfParticipants = self.Participants().length;
    }
}
 
function LoadData() {
    completeParticipantList = new ParticipantListViewModel();
    GetList();
    ko.applyBindings(completeParticipantList);
}
 
function GetList() {
 
    var self = this;
    var clientContext = SP.ClientContext.get_current();
 
    var participantList = clientContext.get_web().get_lists().getByTitle('Participant Values');
    participantItems = participantList.getItems(new SP.CamlQuery.createAllItemsQuery());
    clientContext.load(participantItems);
 
    clientContext.executeQueryAsync(onParticipantsLoadSucceeded, onParticipantsLoadFailed);
}
 
onParticipantsLoadSucceeded = function (sender, args) {
    
    var currentItem = participantItems.getEnumerator();
    while (currentItem.moveNext()) {
        var lyncIdString1 = 'imn_' + currentItem.get_current().get_item("ID").toString() + ',type=sip';
        var lyncIdString2 = 'imn_' + currentItem.get_current().get_item("ID").toString() + '1,type=sip';
        completeParticipantList.AddParticipant(currentItem.get_current().get_item("Title"), currentItem.get_current().get_item("SIP"), lyncIdString1, lyncIdString2);
        nbrOfParticipants = nbrOfParticipants + 1;
 
    }
}


HTML:
<div id="participants">
<span data-bind="foreach: Participants">
<span class="ms-imnSpan">
<a href="#" >
 
<span class="ms-spimn-presenceWrapper ms-imnImg ms-spimn-imgSize-10x10">  
<img name="imnmark" title="" showofflinepawn="1" class="ms-spimn-img ms-spimn-presence-disconnected-10x10x32" src="/_layouts/15/images/spimn.png?rev=23" alt="User Presence" data-bind="attr: {'sip':Sip, id:Id }" /> 
</span>
</a>
</span>
 
<span class="ms-imnSpan">
<a href="#" >
<img name="imnmark" title="" showofflinepawn="1" class=" ms-hide" src="/_layouts/15/images/spimn.png?rev=23" alt="User Presence" data-bind="attr: { 'sip': Sip, id: Id2 }" />
</a>
<span data-bind="text:Name"></span>
</span>
</span>
</div> 


I would really appreciate some help.

Thanks,
William
AnswerWorkflows Pin
Member 1126197124-Nov-14 22:56
memberMember 1126197124-Nov-14 22:56 
QuestionModify default columns for Issue List in SharePoint 2013 Pin
anurag91796-Nov-14 2:24
memberanurag91796-Nov-14 2:24 
QuestionGet selected item ID to disaply in customnized DispForm javascript Pin
linkan942-Nov-14 22:12
memberlinkan942-Nov-14 22:12 
QuestionSharePoint 2013: Modify Subject view of community site to include Group by Category Pin
cdoyle2327-Oct-14 13:07
membercdoyle2327-Oct-14 13:07 
AnswerRe: SharePoint 2013: Modify Subject view of community site to include Group by Category Pin
Ingo28-Oct-14 7:51
memberIngo28-Oct-14 7:51 
AnswerRe: SharePoint 2013: Modify Subject view of community site to include Group by Category Pin
Member 333111331-Oct-14 8:51
memberMember 333111331-Oct-14 8:51 
QuestionInstall sharepoint 2013 ON VHD Pin
espritm19-Oct-14 22:42
memberespritm19-Oct-14 22:42 
AnswerRe: Install sharepoint 2013 ON VHD Pin
espritm19-Oct-14 22:44
memberespritm19-Oct-14 22:44 
GeneralRe: Install sharepoint 2013 ON VHD Pin
Richard MacCutchan19-Oct-14 23:06
protectorRichard MacCutchan19-Oct-14 23:06 
GeneralRe: Install sharepoint 2013 ON VHD Pin
espritm19-Oct-14 23:17
memberespritm19-Oct-14 23:17 
GeneralRe: Install sharepoint 2013 ON VHD Pin
Richard Andrew x6420-Oct-14 7:21
professionalRichard Andrew x6420-Oct-14 7:21 
GeneralRe: Install sharepoint 2013 ON VHD Pin
Richard MacCutchan20-Oct-14 7:58
protectorRichard MacCutchan20-Oct-14 7:58 
AnswerRe: Install sharepoint 2013 ON VHD Pin
ZurdoDev31-Oct-14 9:11
professionalZurdoDev31-Oct-14 9:11 
AnswerRe: Install sharepoint 2013 ON VHD Pin
Ingo5-Nov-14 3:54
memberIngo5-Nov-14 3:54 
QuestionCustome Timer Jobs Pin
PawarNi39-Oct-14 6:54
memberPawarNi39-Oct-14 6:54 
AnswerRe: Custome Timer Jobs Pin
Ingo28-Oct-14 7:54
memberIngo28-Oct-14 7:54 
AnswerRe: Custome Timer Jobs Pin
Kannan Karthikeyan10-Nov-14 7:53
memberKannan Karthikeyan10-Nov-14 7:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.