Uploaded image for project: 'Geomajas GWT2 client'
  1. Geomajas GWT2 client
  2. GWTII-281

VectorServerLayerImpl clearSelectedFeatures() method inconsistency

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.0
    • Component/s: None
    • Labels:
      None

      Description

      Other methods that add/remove feature from selection will first change the model (i.e. map of selected features) and only then send an event to indicate change.
      Event = FeatureSelectedEvent or FeatureDeselectedEvent.

      Current code of "clearSelectedFeatures()" will first send event, then only update model:

      for (Feature feature : selection.values()) {
       eventBus.fireEvent(new FeatureDeselectedEvent(this, feature));
      }
      selection.clear();
      

      Motivation to update code: user may want all selected features when an event is fired. In that case, upon receiving the event, the user will query the layers "getSelectedFeatures()" method. This will be incorrect, in case "clearSelectedFeatures()" method is the origin of the event firing.

      (FYI: it might be an improvement to allow multiple fetures to be (de)selected at once, i.e. Feature(De)selectedEvent containing multiple features => GWTII-282)

        Attachments

          Activity

            People

            • Assignee:
              janv Jan Venstermans
              Reporter:
              janv Jan Venstermans
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: