Glen Urban's Notes/Domino/XPages Blog

 
alt

Glen Urban

 
Glen Urban is a XPages / Lotus Notes/Domino developer/system admin located in the North East of England. He works for IBM Advanced Business Partner FoCul.

XSP.isViewPanelRowSelected: How to confirm if documents are selected in your XPage view control

Glen Urban  May 16 2011 11:47:45 AM
How do you make your XPage buttons work like the standard "Simple Action" Delete button and prompt you if you haven't selected any documents?

If you look at the HTML source of an XPage with a delete button you will see a call to XSP.isViewPanelRowSelected. This accepts two parameters, the first being the name of your view control. If you don't change the default this will be "viewPanel1". The second parameter, I believe, is referring to the actual tick boxes in the view control. So far I haven't needed to change this from "_colcbox".

So here's an example for an "Approve" button...
Image: XSP.isViewPanelRowSelected: How to confirm if documents are selected in your XPage view control

Any server side JavaScript won't get executed unless there a documents selected and you have confirmed you wish to continue.

You can find out more about the XSP JavaScript Library here