Embedded Folder view - First document is opened automatically

I’m not sure if this has been discussed before but I can’t seem to find any folder/view properties to change this.

I have an embedded folder used to display results from a customised search. each time the search is performed, I put the documents in the folder and call a uiview refresh.the view is refreshed but the first document gets opened right after in the same frame.

I am not sure if this is a property setting or a coding problem. Can anyone help?

Subject: RE: Embedded Folder view - First document is opened automatically

Your situation is a little unclear. What is the view embedded in? You also mentioned a frame. Are you displaying a form in a frameset, and the form contains an embedded view? Please be specific.

In what sense does the document open? Does the opened document fill the whole frame, replacing the form or page and the view that was there? How did you get a NotesUIView object to refresh? What happens if you don’t do the refresh? Let’s see your code.

Subject: RE: Embedded Folder view - First document is opened automatically

Pardon my lack of clarity as I’m still new to this forum. I’ll try my best to describe.

The view is embedded in a form and the form is displayed in a the frame when its link is clicked from the embedded outline on the side (ala a website interface)

After a search is done, the whole view is refreshed by calling uiws.ViewRefresh where uiws is the NotesUIWorkspace. The first document in the embedded view is opened at the same time and fills the whole frame. so it replaces the form and the embedded view that the form contains.

I neglected to mention that this form, when previewed on its own in the client without the frame works perfectly. There is no problem with the first document being opened on its own. Only when I’ve fitted it into the embedded outline as a link and open it in the frame does the behaviour exist.

The code for the the customised ‘Search’ button is as follows:

Sub Click(Source As Button)

Dim s As New NotesSession

Dim db As NotesDatabase



Dim uiws As New NotesUIWorkspace

Dim uidoc As NotesUIDocument



Dim Doc As NotesDocument	

Dim dc As NotesDocumentCollection

Dim view As NotesView

Dim mview As notesview

Dim vc As NotesViewEntryCollection



Dim delim As String, word As String

Dim i As Integer, intdocs As Integer

Dim j As Long	



Set uiws = New NotesUIworkspace

Set uidoc = uiws.CurrentDocument

Set db = s.CurrentDatabase

Set view = db.GetView("sortByRNum")		

Set mview= db.GetView("MissingRep")

Set vc= mview.AllEntries



delim = ", "	

intdocs = Cint(uidoc.FieldGetText("numOfDocs"))

Call uidoc.fieldclear("MailText")



If intdocs <>0 Then		

	For i=1 To intdocs

		word = Strtoken(uidoc.FieldGetText("missingNum"), delim, i)

		strWord=strWord + word+" OR "

	Next			

	searchFormula = "field NumeroChrono contains " & Strleftback(strWord,"OR") 		

	'Msgbox searchFormula	

	

	j = view.FTSearch( searchFormula, 0 )

	Call vc.RemoveAllFromFolder("MissingRep")

	Call uiws.viewrefresh		

	Set doc = view.GetFirstDocument()		

	While Not(doc Is Nothing)			

		Call doc.PutInFolder( "MissingRep", True )	

		Set doc = view.GetNextDocument(doc)			

	Wend	

	Call uiws.ViewRefresh

	Call view.Clear		

End If	

End Sub

Personally, I doubt that the problem stems from the view refresh as the problem occurs when the form is opened only in a frame.

Is this clearer? or have I missed out a point?

Subject: RE: Embedded Folder view - First document is opened automatically

I don’t know, but why don’t you just open the folder in the frame instead of a form?

Subject: RE: Embedded Folder view - First document is opened automatically

Because the user needs to view the form at the same time and perform more operations on the documents found by using controls found on the form. I thought it would be neater if I could get the form to open in the frame with the embedded folder working fine…but I guess the simplest way around it would just be to open the form in the fram ‘_new’.

Thanks for your reply anyway!

Subject: RE: Embedded Folder view - First document is opened automatically

It’s a bit of a shot in the dark, but have you got any of the ‘AutoLaunch’ options selected in the Launch tab of the Form Properties? There’s nothing specific for launching the first doc in an embedded view but I guess it might have something to do with it.

Emily.

Subject: RE: Embedded Folder view - First document is opened automatically

Unfortunately that isn’t the problem. Autolaunch is set to ‘None’.But thanks anyway!

Subject: RE: Embedded Folder view - First document is opened automatically

I am experiencing the same behavior, showing a single category based upon the user’s choice in an embedded view. The hotspot formula is: FIELD Division := “COR”;

@Command([ViewRefreshFields])

and it works just fine displaying the right category, except that the view opens the first document. Has any solution has been found to this problem?