Domino 9 und frühere Versionen > Entwicklung

Selected Documents: Markierung aufheben

<< < (2/2)

Glombi:
View Actions Leave Documents Selected After Execution

Problem
After executing a view action, documents that were selected prior to running the view action are still selected - even when one or more documents no longer appear in the view.  This can have adverse effects in some cases because a user may not realize that documents in other views may be selected when they execute the same action, a second action or an agent which acts on currently selected documents.

One example where this could have an adverse effect:

An action uses LotusScript code to act on selected documents using the UnprocessedDocuments property of the NotesDatabase class.  If the action modifies documents such that they no longer appear in the view, then a user would not realize that the documents were still selected after running the action.  If the same view action is executed again (or another that also uses the UnprocessedDocuments property), then documents in other views could be acted upon without the user realizing it.




This issue has been reported to Lotus Quality Engineering.

The following workaround can be used to ensure that selected documents are deselected when the action finishes execution:

1. Place the view action's Simple Action, Formula or LotusScript code within an agent which acts on Selected Documents.

2. Have the view action call the agent in Step 1 using the formula: @Command([ToolsRunMacro]).  

NOTE: The workaround fails if you use the Simple Action "Run Agent" to run the agent.   The workaround does not work in cases where the Formula or LotusScript is designed to open a document in Edit mode.   For example:  In LotusScript the use of either the EditDocument or ComposeDocument methods of the NotesUIWorkspace class would cause the workaround to fail.

Supporting Information:



Related Documents:

LotusScript Agent Running on Selected Documents Does Not Deselect When Finished
Document #:  181093  

Highlighted Document Not Recognized in LotusScript Shared Action Calling a Script Library
Document #:  178707  

TMC:
Danke, Andreas.
Dies bestätigt mir einiges.

Mein hier geposteter Agent deselektiert wohl deshalb weil
 - Agent aus Button aufgerufen wird und der Code nicht in einem Button ist
 - ich hier keine Frontend-Klassen verwende
 - ich hier keine Dokumente lösche
(oder zumindest aufgrund einer Kombination dieser 3 Punkte)

Eine Pauschalisierung lässt sich wohl leider nicht so einfach finden.

Wirklich sicher ist wohl wirklich nur der Workaround mit folgendem Button-Code:
@Command([ToolsRunMacro]; "(RemoveItems)");
@Command([ToolsRunMacro]; "(DeselectAllDocs)")

Wobei hier der 2. Agent nichts anderes macht als @Command([EditDeselectAll])

koehlerbv:
Zwei Anmerkungen:
1) Ein Agent, der auf selektierte Doks in eine View wirkt, hebt nach Ausführung diese Selektion auf. Das ist so, und das ist auch gut so.
Gilt für R4 bis R6 und sollte daher auch in R7 nicht anders sein - andernfalls hätte Iris Mist gebaut.

2) Finger weg bei halbwegs professioneller Programmierung von simple agents - das gehört auch in die Agents-Doku. Simple Agents taugen nix. Wer damit noch nicht hereingefallen ist, darf hier auch nicht mitspielen. Begründungen sind lieferbar, aber es ist schlicht schade um die Zeit hierfür.

Bernhard

Navigation

[0] Themen-Index

[*] Vorherige Sete

Zur normalen Ansicht wechseln