Default List properties behave differently than standard properties

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • 8
    • Affects Version/s: 8
    • Component/s: javafx
    • None

      The difference is in List properties that also have a setter. Take example from RT-17714.

      The following FXML will call the handle method, as the items property in ListView contains the list constructed in the FXML:
      <?import java.lang.*?>
      <?import java.util.*?>
      <?import javafx.collections.FXCollections?>
      <?import javafx.scene.control.ListView?>

      <ListView fx:controller="collectioneventshandler.SampleController"
                         xmlns:fx="http://javafx.com/fxml">
          <items>
          <FXCollections fx:factory="observableArrayList"
                         onChange="#handleListChangeEvent">
              <String fx:value="ABC"/>
          </FXCollections>
          </items>
      </ListView>

      However, using the default property will just add the list content to the items property:
      <?import java.lang.*?>
      <?import java.util.*?>
      <?import javafx.collections.FXCollections?>
      <?import javafx.scene.control.ListView?>

      <ListView fx:controller="collectioneventshandler.SampleController"
                         xmlns:fx="http://javafx.com/fxml">
          <FXCollections fx:factory="observableArrayList"
                         onChange="#handleListChangeEvent">
              <String fx:value="ABC"/>
          </FXCollections>
      </ListView>

            Assignee:
            Martin Sládeček
            Reporter:
            Martin Sládeček
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: