LotusScript creates drag and drop interface in Lotus Notes client

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.

    Requires Free Membership to View

    Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.

    By submitting your registration information to SearchDomino.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchDomino.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

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

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.