use of org.alfresco.web.ui.repo.component.UIAjaxCategoryPicker in project acs-community-packaging by Alfresco.
the class AdvancedSearchDialog method addCategory.
/**
* Action handler called when the Add button is pressed to add the current Category selection
*/
@SuppressWarnings("unchecked")
public void addCategory(ActionEvent event) {
UIAjaxCategoryPicker selector = (UIAjaxCategoryPicker) event.getComponent().findComponent("catSelector");
UISelectBoolean chkChildren = (UISelectBoolean) event.getComponent().findComponent("chkCatChildren");
List<NodeRef> categoryRefs = (List<NodeRef>) selector.getValue();
if (categoryRefs != null) {
for (NodeRef categoryRef : categoryRefs) {
Node categoryNode = new MapNode(categoryRef);
// add a value bound propery used to indicate if searching across children is selected
categoryNode.getProperties().put(INCLUDE_CHILDREN, chkChildren.isSelected());
properties.getCategories().add(categoryNode);
}
// clear selector value after the list has been populated
selector.setValue(null);
}
}
Aggregations