带有domino视图的getJSON-不返回任何数据

带有domino视图的getJSON-不返回任何数据,json,knockout.js,lotus-domino,Json,Knockout.js,Lotus Domino,我正在开发一个基于@TheoHeselmans演示的应用程序,该演示使用Knockoutjs来启用Domino应用程序 我被卡住了一点 我试图使用以下代码在网页上显示Domino视图 self.mainclient.subscribe(function(newValue) { $.getJSON('../api/data/collections/name/json', function(data) { var mappedClients = $.map(d

我正在开发一个基于@TheoHeselmans演示的应用程序,该演示使用Knockoutjs来启用Domino应用程序

我被卡住了一点

我试图使用以下代码在网页上显示Domino视图

    self.mainclient.subscribe(function(newValue) {
        $.getJSON('../api/data/collections/name/json', function(data) {
        var mappedClients = $.map(data, function(item) { return new ClientRow(item); });
        self.renewals(mappedClients);
        });
    }
);

function ClientRow(data) {
    this.Status = ko.observable(data.Status);
}
它不会返回任何数据,也不会显示错误,但我在Domino控制台上看到servlet已启动

我将可观察元素设置如下:

self.renewals = ko.observableArray([]);
self.allclients = [{clientName: "ACME COMPANY"},{clientName: "GG Inc"}];
self.mainclient = ko.observable('');
mainclient通过从下拉列表中选择来设置:

<select class="form-control" id="MainClient" data-bind="options: $root.allclients, value: mainclient, optionsText: 'clientName'">
</select>

最后,模板变量设置为:

 <!-- Knockout JavaScript (+ mapping plug-in and bootbox lib)
================================================== -->
<script src="[DB]js/knockout-3.2.0.js"></script>
<script src="[DB]js/knockout.mapping-latest.js"></script>
<script src="[DB]js/bootbox.min.js"></script>

<!-- Templates -->

<script type="text/html" id="renewal-template">
          <tr>
            <td data-bind="text: Status" /></td>
 </tr>
</script>

<script src="[DB]pages/ko_renewals.js"></script>

以及将其称为:

<table class="table table-striped table-condensed"><tr class="warning"><th>Status</th></tr>
<tbody data-bind="template: { name: renewal-template', foreach: renewals }">
</tbody>
</table>
<pre data-bind="text: ko.toJSON($data, null, 2)"></pre>
状态
元素不返回任何内容-即使它被放置在
中。如果将其放置在
元素中,它将返回值

我试图显示的视图是

对于我错过的任何帮助,我们将不胜感激

谢谢

格雷姆已排序


您是否尝试在浏览器中打开该链接?http[s]:///api/data/collections/name/json您是否为服务器和数据库激活了“Domino数据服务”?
function Renewal(data) {
    this.Country = ko.observable(data.Country);
    this.Status = ko.observable(data.Status);
    this.updatelink = data['@link'] || '';
}

function AppViewModel() {
   var self = this;

   //create empty observable Array
   self.renewals = ko.observableArray([]);
   self.allclients = ko.observableArray([]);
   self.mainclient = ko.observable('');


   //Get list of Countries
   $.getJSON('../api/data/collections/name/(lookupclient)', function(data) {
        self.allclients(data[0].Client);
        self.mainclient(self.allclients[0]);
        }
   );

   //trigger an AJAX request to get tastings when the main country selection changes
   self.mainclient.subscribe(function(newValue) {
        $.getJSON('../api/data/collections/name/json?count=5&keys=' + newValue, function(data) {
        var mappedRenewals = $.map(data, function(item) { return new Renewal(item); });
        self.renewals(mappedRenewals);
        });
    });


}

ko.applyBindings(new AppViewModel());

var vm = ko.dataFor(document.body); //for debugging