Is it possible to open a document Who's name is chosen from a ComboBox list?

I am trying to figure out a way to either create a View “on the fly” containing only documents relevant to the users chooses from 2 combobox lists, Or open a document who’s name is chosen from a combobox list.

I have a frameset where frame 1 is a form containing the 3 listboxes, I would like the other frame to be populated with the document that the user chooses from the lists in Frame 1.

Kind of a condensed version of a view.

We 30 to 40 views created over one DB, making it very confusing for the users to find the documents they are looking for.

Combobox 1 does a DBCOLUMN to grab all “Company Depts”

Combobox 2 does a DBLOOKUP based on the Box 1 selection.

ComboBox 3 is filled via a DBLOOKUP based on the Box 2 selection, and will contain the actual document name.

I’d like to have the ComboBox 3 selection open up in frame 2 with the proper “default form” being used.

I am not a huge fan of the 'Search this View" option. Does anyone have any other options? Suggestions?

I am not asking anyone to write the code, I’m just looking for suggestions, or commands the will point me in the right direction.

(The code needs to work on Notes 5 and Notes 6)

Thanks,

Chad

Subject: Is it possible to open a document Who’s name is chosen from a ComboBox list?

Should be doable. Try using JavaScript to set the location of the other frame, something like

window.parent.frame[1].location=someNotes url here

I guess I haven’t tried that in a long time.

You might have to calculate the proper url using Lotusscript, stick it in a hidden field, then use JavaScript to set the window location, which you can’t do using LS. (I never had any luck getting ws.editdocument to open an existing doc in a specific pane. You should try that but if it doesn’t work this is plan B.)

I would find it simpler to replace those dblookups with script powered by the onChange event of the respective listbox, or in the case of listbox #1, by the PostOpen event of the form. That’s just my preferred way of doing things, @Dblookup would work just as well but is a hassle to debug when doing something complex like this.

You have to put something in frame #2 up front and you may find this works best if you put an empty form or Page in there, as opposed to a view. My little voice tells me if you put a view in frame 2 to start JavaScript might not be able to locate the window when you try to set its location.

Subject: (More remarks) Is it possible to open a document Who’s name is chosen from a ComboBox list?

You might have to calculate the proper url using Lotusscript, stick it in a hidden field, then use JavaScript to set the window location, which you can’t do using LS.

If you go into the onchange event of your listbox you can use it to have JavaScript call click() on hidden buttons on the form. So, to open a specific document in a separate frame, you could try this:

  1. Write one button in LS to figure out the url correspoding to the lsitbox item the user just selected, and push that url into a hidden field.

  2. Write another button to set the location of the adjacenet frame to the url value in the hidden field.

The onChange even would be

document.forms[0].button1.click()

document.forms[0].button2.click()

You have to give each button a name (like ‘button1’), on the html tab. This is case sensitive.

I believe I have got this technique to work in the Notes client though I can’t think of an example right now.

There is an activeX control called Loyal View which would let you accomplish the same effect and probably more easily, and generally make your life a lot easier. Go check it out → www.sisdam.com. It’s superb. They used to have a download but I don’t see it anymore.

Subject: RE: (More remarks) Is it possible to open a document Who’s name is chosen from a ComboBox list?

Tom,

Thanks for the response. I’d love to replace the DBLookups with Javascript in the OnChange events, but I don’t know javascript well enough to figure it.

I’m still missing something with your suggestion though:

I have a hidden field called “docid” and on the Onchange event of the 3rd combobox I have

document.forms[0].B1.click()

B1 is the name of my button, on the HTML tab as well, I am trying to us a Formula on the button click to get the Document URL from a view using a DBLookup and populating the “docid” field with it.

The docid does not ever get filled??? Here is the formula behind the button

FIELD docid:= docid;

@SetField(“docid”;@Unique(@DbLookup(“”;“”;“(LookupUnID)”; Sel_Doc;2)))