Q:

Moving documents between two views

I have created a view which contains some documents. I want to be able to click on the check box next to specific documents and move them to another view (or somehow display them on another page) and back again. So basically I want to be able to archive documents, then go to the page where I have sent these documents and remove them from archive back to the view where the documents were originally.
So far I have (this is my view table which is on the xpage with a check box next to my documents)
<xp:viewPanel rows="10" id="viewPanel2" viewStyle="width:700.0px">
    <xp:this.facets>
        <xp:pager partialRefresh="true" layout="Previous Group Next"
            xp:key="headerPager" id="pager2">
        </xp:pager>
    </xp:this.facets>
    <xp:this.data>
        <xp:dominoView var="allDocsView" viewName="profilesAllDocs">
        </xp:dominoView>
    </xp:this.data>
    <xp:viewColumn columnName="LastActivationDate" id="viewColumn6"
        style="font-size:12pt" showCheckbox="true">
        <xp:viewColumnHeader value="Last Activation Date"
            id="viewColumnHeader6" sortable="true" style="font-size:12pt">
        </xp:viewColumnHeader>
    </xp:viewColumn>
    <xp:viewColumn columnName="LoggerID" id="viewColumn7"
        displayAs="link" openDocAsReadonly="true" style="font-size:12pt">
        <xp:this.converter>
            <xp:convertNumber type="number" integerOnly="true">
            </xp:convertNumber>
        </xp:this.converter>
        <xp:viewColumnHeader value="Logger ID" id="viewColumnHeader7"
            style="font-size:12pt">
        </xp:viewColumnHeader>
    </xp:viewColumn>
    <xp:viewColumn columnName="ExpectedArrivalDate" id="viewColumn8"
        style="font-size:12pt">
        <xp:viewColumnHeader value="Expected Arrival Date"
            id="viewColumnHeader8" style="font-size:12pt">
        </xp:viewColumnHeader>
    </xp:viewColumn>
    <xp:viewColumn columnName="Status" id="viewColumn9"
        style="font-size:12pt">
        <xp:viewColumnHeader value="Status" id="viewColumnHeader9"
            style="font-size:12pt">
        </xp:viewColumnHeader>
    </xp:viewColumn>
    <xp:viewColumn columnName="Alert" id="viewColumn10"
        style="font-size:12pt">
        <xp:viewColumnHeader value="Alert" id="viewColumnHeader10"
            style="font-size:12pt">
        </xp:viewColumnHeader>
    </xp:viewColumn>
</xp:viewPanel>

I have also created a button. The idea is to select some documents using the check box, click on this button and it will send the documents to another xpages (archive).
I am not sure what code to assign to the button and the check box and how the button will know where to send the documents. Any suggestions will be appreciated.

A:

If you need to send documents from one view to another then you need to look at that view's selection formula. Then set the values of required field of the document so that it satisfies that selection formula. The same would go if you want to bring back the document to its original view.
In XPages you can get the selected document's notes ID using the below code (shamelessly lifted from here :))
var viewPanel=getComponent("viewPanel2");
var docIDArray = viewPanel.getSelectedIds();
for(i=0; i < docIDArray.length; i++) {
   var doc = database.getDocumentByID(docIDArray[i]);
    // Code to manipulate the 'doc' object
}

