Advertisement
Guest User

updated search query

a guest
Mar 2nd, 2012
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. <xp:this.search><![CDATA[#{javascript:
  2. var tmpArray = new Array("");
  3. var cTerms = 0;
  4. if(sessionScope.foreignCompany != null & sessionScope.foreignCompany != "") {
  5. tmpArray[cTerms++] = "[foreignCompany] CONTAINS \"" + sessionScope.foreignCompany + "\")";
  6. }
  7. if(sessionScope.ourCompany != null & sessionScope.ourCompany != "") {
  8. tmpArray[cTerms++] = "[ourCompany] CONTAINS \"" + sessionScope.ourCompany + "\")";
  9. }
  10. if(sessionScope.countryOfApplication != null & sessionScope.countryOfApplication != "") {
  11. tmpArray[cTerms++] = "[countryOfApplication] CONTAINS \"" + sessionScope.countryOfApplication + "\")";
  12. }
  13. if(sessionScope.countryOfApplication2 != null & sessionScope.countryOfApplication2 != "") {
  14. tmpArray[cTerms++] = "[countryOfApplication2] CONTAINS \"" + sessionScope.countryOfApplication2 + "\")";
  15. }
  16. qstring = tmpArray.join(" AND ").trim();
  17. sessionScope.queryString = qstring; // this just displays the query
  18. return qstring // this is what sets the search property}]]></xp:this.search>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement