Click here to Skip to main content
14,689,466 members
Home » Discussions » SharePoint
   

SharePoint

 
QuestionError in Web Part Errors and Form Authentication Disable Pin
Peace4all31-Dec-14 19:56
MemberPeace4all31-Dec-14 19:56 
AnswerRe: Error in Web Part Errors and Form Authentication Disable Pin
Krishna Murthy G24-Mar-15 2:52
professionalKrishna Murthy G24-Mar-15 2:52 
QuestionDocument Library error - The security validation for this page is invalid Pin
Gautam15-Dec-14 4:32
MemberGautam15-Dec-14 4:32 
QuestionRe: Document Library error - The security validation for this page is invalid Pin
Pradip R16-Dec-14 4:41
MemberPradip R16-Dec-14 4:41 
SuggestionRe: Document Library error - The security validation for this page is invalid Pin
Gautam18-Dec-14 23:42
MemberGautam18-Dec-14 23:42 
QuestionSharePoint 2013 web service Pin
dcof10-Dec-14 4:49
Memberdcof10-Dec-14 4:49 
AnswerRe: SharePoint 2013 web service Pin
Ingo17-Mar-15 23:55
MemberIngo17-Mar-15 23:55 
QuestionLync presence in SharePoint app part Pin
Member 1124629326-Nov-14 4:46
MemberMember 1124629326-Nov-14 4: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 23:56
MemberMember 1126197124-Nov-14 23:56 
QuestionModify default columns for Issue List in SharePoint 2013 Pin
anurag91796-Nov-14 3:24
Memberanurag91796-Nov-14 3:24 
QuestionGet selected item ID to disaply in customnized DispForm javascript Pin
linkan942-Nov-14 23:12
Memberlinkan942-Nov-14 23:12 
QuestionSharePoint 2013: Modify Subject view of community site to include Group by Category Pin
cdoyle2327-Oct-14 14:07
Membercdoyle2327-Oct-14 14:07 
AnswerRe: SharePoint 2013: Modify Subject view of community site to include Group by Category Pin
Ingo28-Oct-14 8:51
MemberIngo28-Oct-14 8:51 
AnswerRe: SharePoint 2013: Modify Subject view of community site to include Group by Category Pin
Member 333111331-Oct-14 9:51
MemberMember 333111331-Oct-14 9:51 
QuestionInstall sharepoint 2013 ON VHD Pin
espritm19-Oct-14 23:42
Memberespritm19-Oct-14 23:42 
AnswerRe: Install sharepoint 2013 ON VHD Pin
espritm19-Oct-14 23:44
Memberespritm19-Oct-14 23:44 
GeneralRe: Install sharepoint 2013 ON VHD Pin
Richard MacCutchan20-Oct-14 0:06
mveRichard MacCutchan20-Oct-14 0:06 
GeneralRe: Install sharepoint 2013 ON VHD Pin
espritm20-Oct-14 0:17
Memberespritm20-Oct-14 0:17 
GeneralRe: Install sharepoint 2013 ON VHD Pin
Richard Andrew x6420-Oct-14 8:21
professionalRichard Andrew x6420-Oct-14 8:21 
GeneralRe: Install sharepoint 2013 ON VHD Pin
Richard MacCutchan20-Oct-14 8:58
mveRichard MacCutchan20-Oct-14 8:58 
AnswerRe: Install sharepoint 2013 ON VHD Pin
ZurdoDev31-Oct-14 10:11
mveZurdoDev31-Oct-14 10:11 
AnswerRe: Install sharepoint 2013 ON VHD Pin
Ingo5-Nov-14 4:54
MemberIngo5-Nov-14 4:54 
QuestionCustome Timer Jobs Pin
PawarNi39-Oct-14 7:54
MemberPawarNi39-Oct-14 7:54 
AnswerRe: Custome Timer Jobs Pin
Ingo28-Oct-14 8:54
MemberIngo28-Oct-14 8:54 
AnswerRe: Custome Timer Jobs Pin
Kannan Karthikeyan10-Nov-14 8:53
MemberKannan Karthikeyan10-Nov-14 8: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.