Click here to Skip to main content
16,016,345 members

Comments by Member 11246293 (Top 3 by date)

Member 11246293 26-Nov-14 9:39am View    
I found the issue, I didn't pass appWebUrl correctly. Thanks Pradip R.
Member 11246293 26-Nov-14 9:28am View    
Thank you for your reply.

I don't understand, it doesn't matter what I enter as title:"xxxx" as it is just displayed at the top of the dialog? Please explain.
Member 11246293 19-Nov-14 7:56am View    
Deleted
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.

Here is the code:

<pre>
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;

}
}
</pre>

HTML:
<pre>
Collapse | Copy Code
<div id="participants">
<span data-bind="foreach: Participants">
<span class="ms-imnSpan">


<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>

</span>

<span class="ms-imnSpan">

<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 }" />

<span data-bind="text:Name"></span>
</span>
</span>
</div>
</pre>