I'm trying to filter a viewPanel using its search
property. The viewPanel hasn't any categorized column.
These documents are using readers and authors fields. One problem is the fact that I'm getting some empty rows in views representing the "hidden" documents.
The filter input fields are all contained in Doc. type, and as well in Response type.
var tmpArray = new Array("");
var cTerms = 0;
var dateFormatter = new java.text.SimpleDateFormat( "MM-dd-yyyy" );
if (sessionScope.compA) {
tmpArray[cTerms++] = "(Field Comp = \"*" + sessionScope.compA + "*\")";
tmpArray[cTerms++] = "(Field Compania = \"*" + sessionScope.compA + "*\")";
/* Comp - the field from Doc. & Compania - the field from Response */
}
if (sessionScope.numePro) {
tmpArray[cTerms++] = "(Field NumeProiect = \"*" + sessionScope.numePro + "*\")";
tmpArray[cTerms++] = "(Field Proiect = \"*" + sessionScope.numePro + "*\")";
/* NumeProiect - the field from Doc. & Proiect - the field from Response */
}
if (sessionScope.din && sessionScope.pana) {
tmpArray[cTerms++] = "Field _creationDate >= " + dateFormatter.format(sessionScope.din) + " AND Field _creationDate <= " + dateFormatter.format(sessionScope.pana);
}
qstring = tmpArray.join(" OR ").trim();
sessionScope.queryString = qstring;
return qstring
But I don't get the expected results, I do get something like: the correct documents for sessionScope.compA, but if I add a value for the 2nd sessionScope.numePro which isn't contained in any documents listed by the view, the results are the same, and there should be no result.
How can I achieve this?