Question

I have a problem that have me stumped. I have been searching for a solution, but haven't found a working one yet. The solutions I seen introduces other issues.

Here is the scenario: I have a frameset with two frames: 'Navigator' and 'Main'. In the 'Navigator' frame I display a form called 'Navigator'. It contains an outline, to display a menu. In the 'Main' frame I display the view selected by the user in the navigator. So this is a very traditional Notes client application.

I now want to add a checkbox at the top of the view (in the action bar), allowing the user to filter the view by his/her own name. I use @SetViewInfo for this, and it all works perfect.

The issue is when the user switch views. The @SetViewInfo filter stays active when switching to a different view, so after some searching I found some solutions:

In http://www-01.ibm.com/support/docview.wss?uid=swg21204481 IBM suggests to put the following code in the QuerySave event:

@SetViewInfo([SetViewFilter]; temp ; 0 ;1) 

When I am switching view or closing the view, I get the error message "Cannot execute the specified command".

In http://www-10.lotus.com/ldd/bpmpblog.nsf/dx/using-setviewinfo-in-a-notes-client-application-to-create-a-user-specific-view Andre Guirard suggests to put the following code in the QuerySave event:

@SetTargetFrame("frameName");
@UpdateFormulaContext;
@Command([OpenView]; @Subset(@ViewTitle; -1));
@SetViewInfo([SetViewFilter]; ""; "columnName"; 1)

I modify this to match my frame name and the programatic name of the first column in my view:

@SetTargetFrame("Main");
@UpdateFormulaContext;
@Command([OpenView]; @Subset(@ViewTitle; -1));
@SetViewInfo([SetViewFilter]; ""; "Adjuster"; 1)

This works perfectly when switching between view. But when I close the application while I am in this particular filtered view, the application is re-opened automatically. This happens no matter if the filter is enabled or not when closing the view.

However, when the view repopens, the frameset is not reloaded, it is just the view with the built-in view navigator to the left. I finally got this to work by (in the built-in view navigator) selecting another view that the one where I filter data. This fixed the issue for a while, but then it starts again, and the filtered view is active in the navigator.

Obviously it is the OpenView command that is causing this, but if I remove just that line, I get the "Cannot execute the specified command" error again.

Any suggestions/pointers? I am using Notes 8.5.3 running on Windows 7 Professional.

This question can also be found in the IBM developerWorks forum for Notes 8.5: http://www-10.lotus.com/ldd/nd85forum.nsf/DateAllThreadedWeb/08c73910571306c485257b2b0061ef91

Était-ce utile?

La solution

First thing, I would suggest to make sure your view frame is always called "NotesView". You will have much less compatibility issues if you do this.

Secondly, I presume when you say you put it in the QuerySave event you really mean the QueryClose event? Views do not have a QuerySave event.

Thirdly, I find the @UpdateFormulaContext line is not needed. This is what I have in my view QueryClose...

@SetTargetFrame("NotesView");
@Command([OpenView]; @Subset(@ViewTitle; -1));
@SetViewInfo([SetViewFilter]; ""; "<programmaticColumnName>"; 1)

And I can close the app while in the view without any problems.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top