Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-28883

List.requireSelection doesn't always work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Adobe Flex SDK Previous
    • None
    • Spark: List
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Browser: Other (specify version)
      Language Found: English

    Description

      Steps to reproduce:
      1. Create a ListCollectionView and a filterFunction to it.
      2. Create a List set requireSelection to 'true' and apply the collection as the dataProvider to a List.
      3. Filter the collection so that all items are removed.
      4. Filter the collection so that items are added again.

      Actual Results: The list shows the items without any selection.

      Expected Results: Due to 'requireSelection' being set to 'true', if the List displays items, one should be selected.

      Workaround (if any): This is due to 'requireSelection' only being applied once in commitProperties after it is set.

      commitProperties lines 907-920

      if (requireSelectionChanged)
      {
      requireSelectionChanged = false;

      if (requireSelection &&
      selectedIndex == NO_SELECTION &&
      dataProvider &&
      dataProvider.length > 0)

      { // Set the proposed selected index here to make sure // commitSelection() is called below. _proposedSelectedIndex = 0; }

      }

      When a collection is reset or refreshed the 'requiredSelection' property should be checked and if true 'requireSelectionChanged' should be set to 'true' so that selection is forced again in commitProperties.

      Attachments

        Activity

          People

            paeros Mark Kessler
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: