@SetViewInfo and computed view in frames

I have a @SetViewInfo in the PostOpen event of a view and in the queryclose event of the view and it works correctly when I open the view by itself.

The problem is when I try to use that view as a computed view in a frameset, I get “cannot execute the specified command” when the view opens and closes. (It works correctly when I switch to that view from the outline.)

I also tried: instead of having a computed view in the main frameset, I put the view inside a sub-frameset which gets computed, but I still get an error.

(When I preview the sub-frame, it works correctly - it seems that there’s a problem with the computed part that throws off the focus of the PostOpen event.)

What seems to be happening is that, for some reason, the @setViewInfo in the PostOpen event of the view isn’t targeting it own view.

I have tried setting the @SetTargetFrame within the frames, and even within the View PostOpen event.

What I am trying to do is open a default view based on the user’s role. I have a standard navigator page in a frame on the left and the computed view appears in the frame on the right.

If the user is a client, then a view opens showing their own projects, if a user is a staff member, a view opens showing only the projects assigned to them, and if the user is an manager, a view opens showing all the projects. It was working when I used embedded views, but I would prefer using @setViewInfo so that the contextual action buttons will work (show and hide based on field values).

Subject: Half a solution?!?

I think the problem is that the view frame doesn’t have focus. I had this problem (without a computed view), but it was corrected by setting the “Set Initial Focus” property on the view frame.

Unfortunately, I also want to clear the filter in the view’s QueryClose event, but when you put focus on the navigation frame (by clicking there to select another view), I get the same error again. Not sure how to fix it this time.

Subject: Full solution

In case you never found a good fix, I ran into the same problem and was disouraged by Lotus’ “no plan to fix ever” ( http://www-1.ibm.com/support/docview.wss?uid=swg1LO09216 ), until I came across Andre Guirard’s solution:

@SetTargetFrame(“NotesView”);

@UpdateFormulaContext;

@Command([OpenView]; @Subset(@ViewTitle; -1));

@SetViewInfo([SetViewFilter]; “”; “”; 1)