XPages: How do I select all documents in a categorized column of a view control

独自空忆成欢 提交于 2019-12-11 17:57:17

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/15796567/xpages-how-do-i-select-all-documents-in-a-categorized-column-of-a-view-control

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!