16,016,345 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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>