0
votes

I am using a standard view control in xpages which has a checkbox for selecting a number of documents which can then be processed. I would like to add a radio button (yes/no) selection for each document in the view. What's the best and easiest option to achieve this?

edited: what I am looking for is inline editing I guess in an xpages view to edit value of each document in a view using a radio button.

By the way it doesn't have to be a standard view control, I can change it to data tables or repeat controls if that will help me achieve this.

1
I wouldn't do that, according to UX practices. High count of radiobuttons is nightmare of UI, I think.Frantisek Kossuth
What are you trying to achieve? is radio button the requirement?MarkyRoden
There are going to be less than 10 docs in the view, never more and yes radio button is a requirement unfortunately!pipalia
This is Ecommerce app and these are repeat customers, so when they renew the service, I want to ask them a question for each item when they renew and let them answer in the form of yes/no.pipalia
What is your "transaction"? Will you have single Save button to update all documents in batch, or you want to update immediately after value change?Frantisek Kossuth

1 Answers

1
votes

Could you simply use the Checkbox property in the view column? checkbox property on a view column

Then you could also make use of the SSJS with something like this:

var viewPanel=getComponent("viewPanel1");get the componet of viewPanel
var docIDArray=viewPanel.getSelectedIds(); get the array of document ids
for(i=0;i < docIDArray.length; i++){
    var docId=docIDArray[i];
    var doc=database.getDocumentByID(docId); 
    //.. your code to deal with the selected document
}