Tip

LotusScript creates drag and drop interface in Lotus Notes client

I was recently asked to create a user interface in the Lotus Notes client that would allow my users to drag and drop documents from one view (the source) into other views (the destination) in the same window.

In my example, the source view contained Mail Received and the three destination views were: On Hold, In Process and Completed.

After several attempts using the drag and drop events available in the View and DB event handlers, I found that the events don't work between views. This functionality only seems to works with folders. So I came up with a simple solution.

  1. Create a frameset and define the source and destination views. Be sure to assign a suitable name to each frame.
  2. Note: The trick was figuring out which documents were selected in the source view as they are dragged into the destination view.

  3. In the QueryDragDrop event of the destination view, include the following LotusScript code:
    Call ws.SetTargetFrame("SourceFrame") 
    'this is the key
    Set uiview = ws.CurrentView
    Set DocColl = uiview.Documents
    

    The SetTargetFrame changes the reference to the source view and voila, you get the document collection.

  4. With the collection in hand, write the required code in the PostDragDrop event of the respective target view.

That's all it takes. You now have a cool drag and drop feature that users can play without the worry of action buttons.

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip library by member Vijay Sreegiriraju. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes/Domino technical tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

This was first published in May 2010

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.