XPages remove documents on server and trigger partial refresh
===

I am struggling with the following.

On my XPage I have a viewpanel component, but it is not bound to a notesview datasource, but to a hashmap stored in viewScope. Reasons for this is beyond scope of my question. 

Since the lines in my view are not actually linked to the documents I cannot use the standard checkboxes and the related getSelectedDocIds. I do however want a way to remove the selected documents. I have a column with checkboxes containing the unid of the corresponding row.

So long story short. I have an array of unids and want to perform an action that does the following:

- Display a dijit.Dialog asking for confirmation
- If OK clicked call a function that does the following:
 * Remove the documents based on the unids
 * Refresh the viewpanel


I am thinking of the following 2 solutions, but in doubt what would be best (maybe a third, even simpler solution?)

1. Have the OK button of the dojo dialog call a function that does an XmlHttpRequest to an XAgent or plain old LS agent
 
2. Have the OK button trigger an eventhandler that runs on the server as described by JeremyHodge [here](http://xpagesblog.com/XPagesHome.nsf/Entry.xsp?documentId=88065536729EA065852578CB0066ADEC). But how would I pass the unids as parameter and refresh the view afterwards?

Thanks!



