0
votes

I have a View control where the first column is categorized. I have found how to put a checkbox on the column header but that isn't what I'm looking for. I want to be able to select all documents in a category. If I set the Check Box property on the categorized column, I get a checkbox for that column on each row. I want one checkbox next to the category name.

2
You're almost guaranteed to be better off switching to a repeat control. View panels are convenient when you want everything done for you, but if you want any customization at all (with the exception of a very simple join), all of the pre-existing assumptions of the view panel tend to get in the way. Yes, repeats are blank slates, so you then must do all the UI yourself, but then you have full control.Tim Tripcony
Thanks, Tim. I have been looking at the Data View control but can't see how to add a checkbox to the category column. Is that possible?Don McNally
Yes, the Data View component includes a property of showCheckbox. If true, each row that represents a document will include a checkbox column... but not the rows that represent categories.Tim Tripcony
Out of curiosity, what's the use case for this? If this worked the way you want it to, what would the user say they're doing?Tim Tripcony
Use case is documents being marked "ready for disposal" categorized by their storage location. I want them to select a storage location and have all the documents in that location (category) be selected so they can be marked "disposed". The user would say they are selecting a storage location for disposal.Don McNally

2 Answers

3
votes

I think you are trying to create a design pattern that most people would find confusing. If you look at most Web-based applications that display tree-data (which a categorized view really is), then the usual approach would be when a parent node (category) is selected then this would trigger all its children being selected. The same thing in reverse when unselecting. When you map this to a categorized view one implementation would be to have a single column of check-boxes (which you now have). You will need to write the code to handle the click event to populate the check boxes for all the child nodes as this is not a feature of any of the XPages view controls.

0
votes

I gave up and went in a different direction. I now show a list field of the storage locations with checkboxes for each entry. I do not show the detail from the documents for each of the locations. The users can choose the location IDs they want and the action button goes and gets the collection of documents for each chosen location and updates them behind the scenes.

I still think the pattern is a useful one. This is an example of what I wanted to do (explanation), though I hadn't thought about the "indeterminate" state. On the example page, click one of the top-level entries and you'll see what I was going for.

Thanks, Peter and Tim, for weighing in.