Thank you for the prompt reply! I really appreciate it. I've worked all weekend on this and I am making some progress. My problem is that I display many document types in the ViewGrid. This means that I need to get the UNID from the ViewGrid and then figure out which XPage to open. I am doing this by putting the UNID into a field bound to a sessionScope “docUNID” variable. I then fire the click event of a button that submits the XPage. The navigation for the next XPage to open is computed. The code here gets the NotesDocument by UNID and then gets the FORM item value. It decides which XPage to open based on the FORM. When the XPage opens (in the same db) it is set to get data from the other database and the document ID to open is set to the “docUNID” sessionScope variable. This part all works well. The problem I am stuck on is to do with using the onRowClick event of the ViewGrid. I created a CSJS script library with a simple test function:
function openDoc(){
var vgID = '#{id:ViewGrid}' + '_widget';
var vgwidget = dijit.byId(vgID);
alert(vgwidget.getSelection(true));
//code to populate the field and click the button will go here
}
I then put openDoc(); into the onRowClick property of the ViewGrid. Unfortunately this causes the openDoc() function to fire when the XPage is loading and then the ViewGrid fails to load. It seems that I don't understand how the onRowClick property should be used. I've been banging my head against this problem for hours with no progress. I'm new to this (as you can guess) so any help at all with this problem would be really appreciated. Thanks!