ユーザーが検索する最大 6 つの異なるフィールドのいずれかを選択できる検索画面を備えたカスタム コントロールがあります。2 つの日付フィールドを除いて、他のすべてのフィールドを問題なく動作させることができました。開始日と終了日の両方を入力することも、どちらか一方だけを入力することもできます。かなり標準的なものですが、クエリを機能させるコードを記述して、日付が含まれる場合に検索を実行させる方法がわかりません。
var tmpArray = new Array("");
var cTerms = 0;
if(requestScope.cmbSendTo != null & requestScope.cmbSendTo != "") {
a = @Right(requestScope.cmbSendTo, "(");
b = @Left(a,3);
tmpArray[cTerms++] = "(FIELD Mnemonic = \"" + b + "\")";
}
if(requestScope.edtFrom != & requestScope.edtFrom != "") {
tmpArray[cTerms++] = "(FIELD From = \"" + requestScope.edtFrom + "\")";
}
//**************************************************************************
if(requestScope.edtDateRangeFrom != null & requestScope.edtDateRangeFrom != "") {
tmpArray[cTerms++] = "(FIELD DeliveredDate >= \"" + requestScope.edtDateRangeFrom + "\")";
}
if(requestScope.edtDateRangeTo != null & requestScope.edtDateRangeTo != "") {
tmpArray[cTerms++] = "(FIELD DeliveredDate <= \"" + requestScope.edtDateRangeTo + "\")";
}
//**************************************************************************
if(requestScope.edtOriginal != null & requestScope.edtOriginal != "") {
tmpArray[cTerms++] = "(FIELD SourceFilename = \"" + requestScope.edtOriginal + "\")";
}
if(requestScope.edtCaptiva != null & requestScope.edtCaptiva != "") {
tmpArray[cTerms++] = "(FIELD Filename = \"" + requestScope.edtCaptiva + "\")";
}
qstring = tmpArray.join(" AND ").trim();
requestScope.queryString = qstring;
return qstring
任意の支援をいただければ幸いです
この画面の背後にあるアイデアは、次のビデオから引用されています: XPages ビュー コントロール - 全文検索の追加 - http://www-10.lotus.com/ldd/ddwiki.nsf/dx/XPagesViewControlAddFullTextSearch.htm