• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 223
  • Last Modified:

Web View

Hi,
I have a view which lists documents categorized based on countries. Now I want a way so that I can use a Dialog box in the $$viewtemplate form . I can select the country from this dialog box and to list all documents of that category . Something similar to
the link in http://www.lotus411.com 
program tips.

Thanks for the help in advance
RAjen
0
Rajen
Asked:
Rajen
  • 5
  • 3
1 Solution
 
melbor1Commented:
1.  Set up a view for each country.
2.  On the $$ViewTemplateDefault have a keyword field and a field called ViewName.  
3.  Based on the selection in the drop down box, set the ViewName field to the name of the view that should be displayed. (ViewName is a computed field )
4.  Use an embedded view for the view to be displayed.  When you created the embedded view, select 'Choose a view based on a selection formula'
5.  Enter ViewName in the view selection area.

this should work....make sure your keyword selection field has the property 'Refresh fields on keyword change' so it changes every time.

Good luck!

Melissa
0
 
RajenAuthor Commented:
Is it possible to do with a single view
0
 
melbor1Commented:
To do this you would have to use a URL to open the view.

Example:

http://www.website.com/database.nsf/viewname?openview&StartKey=F


I'm not sure how you would implement this with the selection box.

Melissa
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
RajenAuthor Commented:
Hi Mellisa,
Thanks for your hint. Now I have used a form where I have embedded the view. I have a keyword field in the form which looks up for the country name from another view. In the HTMl attributes of this form I have written java script to submit the form on keyword change.
I also have a$$Return field and I open the this form passing the Startkey with the county selected. Now everything works fine, except the view also shows the other documents.
Ex If I select Belgium. It shows belgium documents followed by documents of Cananda .

Is there any way I can restrict it to show only the documents of  the country I used in the Startkey parameter.

Rajen
0
 
melbor1Commented:
This is the very reason I suggested separate views.  However, the only thing I can come up with is, if you know how many documents there are for that country you can make the URL look like this:

http://server/database.nsf/view?openview&startkey=Belgium&Count=15

where count is the number of documents.

If you could somehow set a field to the current number of documents for that country, then concantenate the number into the URL, it would work.

Good Luck!

Melissa
0
 
RajenAuthor Commented:
Hi Mellisa,
Thanks for your suggestion. I have implemented the view. I added a field in the form which based on the selection done checks the number of documents in a view using dblookup. The value of this field I pass it to the $$returnfield
"["+Dbname+"/Category?OpenForm&StartKey="+Countryfield+"&Count="+@text(Counterfield)+"]"
it works now except for the reason it once refreshes to change the value in the newly added field and user has to press the button to submit.Any suggestion for this is appreciated
Thanks
Raj
0
 
RajenAuthor Commented:
Hi Melisa,
I have done it. It works fine
Thanks
Rajen
0
 
RajenAuthor Commented:
Hi Melisa,
I have done it. It works fine
Thanks
Rajen
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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