Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 290
  • Last Modified:

Document count for internet based searches.

I have a R5 database running on the web.  In that I have various methods of searching the database.  Either though list boxes which return documents based on that category using an embedded view on a page.  The other way is using a serach bar which uses:

dbpath + "Searching?SearchView&Query=" + QueryString + "&Count=6&Start=1"

I am trying to display on the respective page & form the number of documents returned from the search and then use that number to hide/change the Next/Previous buttons.

Does that make sense??  Can anyone help?

Just to note the new pages are loaded using Javascript and not through a notes agent.
0
Controversy
Asked:
Controversy
  • 3
  • 2
1 Solution
 
CRAKCommented:
I have once seen a solution like that. It was bases on a $$viewtemplate with a $$ViewBody field.... I'm not sure if it also works for an embedded view. I can put a lot effort in right now (sorry for that), so you'll have to check that yourself. It does require some knowledge of stylesheets and Javascript!

You'll need to have the view size limited to e.g. 20 (or whatever you prefer).
In case of 20, bear in mind that domino always shows 1-20, 20-39, 39-...: the last document on a page gets displayed as the 1st on the next one. Thus: the very last page may contain only one page that was already shown on the previous page. In case of 20 search results: page 1 shows 1-20, page 2 shows #20 only.

Retrieve the Start-parameter's value from Query_String (or Query_String_Decoded).

Hide "Previous" when Start = "1" or Start = "".

Set a style to the next button (in a Div). Set visibility="hidden" by default. Use some ID to address the style later.

In the onLoad event (javascript) determine document.links.length and compare it to the maximum view size. If I remember well, you should set document.getElementById(<your styles ID>).style.visibility = "visible" when Start equals or exceeds (I can't check that right now) the max. view size.

Be aware that any additional links on the $$ViewTemplate may / will affect the value returned by document.links.length. Not sure if there was a correction for that somehow.

Anyway, I hope this points you in the right direction or is considered an assist in someone elses goal.
Good luck!
0
 
CRAKCommented:
Small but important typo made: I can't (as in "can NOT") put in a lot of effort....
0
 
ControversyAuthor Commented:
Cheers for the pointer.  I will look into it.  I use the $$ViewBody on the form which displays the results of the second way of searching the database - ie the search bar.

Will keep you posted.
0
 
ControversyAuthor Commented:
Thanks for your help Crak.  Got everything working now.
0
 
CRAKCommented:
Excellent job!
Thanks!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now