Ignore:
Timestamp:
08/14/15 12:04:16 (9 years ago)
Author:
davor.ostojic@oeaw.ac.at
Message:

multi value search for a single facet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/FacetPanel.java

    r6431 r6456  
    8181
    8282        final boolean valuesSelected = !getModelObject().getFacetValues().isEmpty();
    83         //show both for multi values
    84         facetValuesPanel.setVisible(!valuesSelected);
     83        facetValuesPanel.setVisible(true);
    8584        selectedFacetPanel.setVisible(valuesSelected);
    8685
     
    105104                    public void onValuesSelected(String facet, FacetSelection value, AjaxRequestTarget target) {
    106105                        // A value has been selected on this facet's panel, update the model!
    107                         FacetPanel.this.getModelObject().getSelection().selectValues(facet, value);
     106                        FacetPanel.this.getModelObject().getSelection().addNewFacetValue(facet, value);
     107                        //FacetPanel.this.getModelObject().getSelection().selectValues(facet, value);
    108108                        if (target != null) {
    109109                            // reload entire page for now
     
    121121
    122122                // Values have been removed, calculate remainder
     123               
    123124                final FacetSelection facetSelection = selection.getSelectionValues(facet);
    124                 final Collection<String> currentSelection = facetSelection.getValues();
    125                 final Collection<String> newSelection = new HashSet<String>(currentSelection);
    126                 newSelection.removeAll(valuesRemoved);
     125//                final Collection<String> currentSelection = facetSelection.getValues();
     126//                final Collection<String> newSelection = new HashSet<String>(currentSelection);
     127//                newSelection.removeAll(valuesRemoved);
    127128
    128129                // Update model (keep selection type)
    129                 selection.selectValues(facet, new FacetSelection(facetSelection.getSelectionType(), newSelection));
     130//                              selection.selectValues(facet, new FacetSelection(facetSelection.getSelectionType(), newSelection));
     131               
     132                FacetSelection fSelToRemove = new FacetSelection(facetSelection.getSelectionType(), valuesRemoved);
     133                selection.removeFacetValue(facet, fSelToRemove);
    130134
    131135                // collapse after removal
Note: See TracChangeset for help on using the changeset viewer.