XPages では、チェック ボックスで選択された値に基づいてビューから値を抽出しようとしています。
を含む「viewpanel2」というビューがありLoggerID
、それぞれLoggerID
が数値で構成されています。
LoggerID
横のチェックボックスが選択され、ボタンがクリックされたときに、javascript を使用してビューから値を抽出するボタンがあります。私が抱えている問題は、LoggerID
選択されたものだけでなく、ビュー内のすべての のすべての値を出力し続けることです。
ボタンのコードは次のとおりです。
var viewPanel = getComponent("viewPanel2"); //in the view panel select the check box
var docIDArray = viewPanel.getSelectedIds(); //get that selected ID
for (i = 0; i < docIDArray.length; i++) {
var docId = docIDArray[0];
var doc = database.getDocumentByID(docId);
var moo = doc.getItemValue("LoggerID"); //selected ID is defined
var vw = database.getView('BrowserStats'); //Get the Notesview
var vwEntries = vw.getAllEntries(); //Get handle of all entries
var vwCount = vwEntries.getCount(); //Get the Count to use as uBound
var vwEntry = vwEntries.getFirstEntry(); //Get first value
//Get the first entry and get the column value of the first entry
var plot_LoggerID = vwEntry.getColumnValues().elementAt(2);
for (var x = 1; x < vwCount; x++) {
//Looping through all the entries and collect the column values
vwEntry = vwEntries.getNextEntry(vwEntry);
plot_LoggerID = plot_LoggerID + "," + vwEntry.getColumnValues().elementAt(2);
}
//comparing the entries to the selected ID and if found extracting the values for LoggerID
}
if (moo = vwEntry) {
getComponent("extracted_LoggerID").setValue("["+plot_LoggerID+"]");
} else {
print = ("no data available");
}
私が持っているif条件が機能していないと思います。誰でも解決策を提案できますか?