Deleting documents in a view via icons

When I was reading The View article ‘Using AJAX techniques in Domino Applications, Part 2’ I noticed a functionality in the sample application I was not aware of before, but could be very usefull in my applications.

In the sample DB you can move up, downwards and delete documents in a view by icons for each document.

I only needed the delete function so that is what this item is about.

delete doc picture 1

First in the view you define a column, set the property of ‘Display values as icons’, define a column value (a reference to an image resource)  and in the last / programmatic use tab you enter a ‘Name’, in this case ‘Delete’:

delete doc picture 2

In the Globals of that same view you make a reference to a Script Library called ‘Controls’:

delete doc picture 3

The Script Library itself is not so spectaculair. In the Declarations you add:

%INCLUDE “LSConst.lss” 

You also add a Sub function, in this case it is called DeleteItem. The main statement in this Sub is the line:

Call Qdoc.Remove ( True )Which is the document the user will click on in the view. In order to make the changes noticeable for the user the following statement is also added:

Set view = db.GetView(“v-projects”)

Call view.refresh

If you are interested in the function, I advice you to download the application if possible and see for yourself if it is usable for you…

Advertisements

14 thoughts on “Deleting documents in a view via icons

  1. ganesh 2007-July-9 / 1:55 pm

    hi
    can you please send the sample db for deleteing document from web. im stuggling in that part

    regards
    ganesh

  2. Mirek Navratil 2007-July-10 / 12:29 pm

    to ganesh: check http://www.eview.com site for May/June 2007 issue. The sample can be find in Using AJAX techniques…. article.

  3. Dani Tal 2008-January-10 / 10:02 pm

    Hi,
    You specified ‘Controls’ but the screen shot shows “Use Control”

    That does’nt work for me.
    Can you sned me a sample DB?

    BR

  4. Jorge Ricardez 2008-July-3 / 5:28 pm

    Can you send me an example of this db …. I need to make a selection of all documents in order to remove from a folder ….

  5. Maximiliano 2009-February-24 / 4:25 pm

    Can you send me that sample DB please?
    thank you

  6. quintessens 2009-February-24 / 8:23 pm

    Sorry, I can not find an example db 1-2-3..

  7. Maximiliano 2009-February-24 / 8:23 pm

    Sorry, now i saw your answer to ganesh.

  8. quintessens 2009-February-24 / 8:38 pm

    wait, i found the code in another application, I will post it here as a new article…

  9. Maximiliano 2009-February-24 / 9:23 pm

    Can you tell me why I get an ‘Illegal circular use: Control’ when i add the value “‘se: “control”‘ to the (options) field?

    I’ll really appreciate your answer.
    Thanks

  10. quintessens 2009-February-24 / 10:50 pm

    Write:

    Option Public
    Use “Control”

    in the View. Does this work?

  11. amar mahtani 2011-September-20 / 11:12 pm

    I downloaded the NSF sample and was able to trace the Delete Action. However I am unable to figure out how the Delete Icon invokes the InViewEdit event.

    Other forums mentioned making the Delete Icon an Editable Column, but the editable column is grayed out in the Sample, but it still works. Any help on this would be really appreciated, Thank you.

  12. louie 2013-June-27 / 12:08 pm

    where is the control script library

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s