title: Why can't I specify NamedArgs and item elements on cellFactory?
body: <p>I have the following tableView in fxml</p>
  
  <pre><code>&lt;TableView fx:id="tableView" prefHeight="525.0" prefWidth="814.0"&gt;
    &lt;columns&gt;
      &lt;TableColumn prefWidth="75.0"&gt;
        &lt;graphic&gt;&lt;ToggleButton fx:id="mainToggleButton" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" onAction="#onMainToggleButtonAction" text="Start all" /&gt;&lt;/graphic&gt;
        &lt;cellFactory&gt;&lt;ToggleButtonTableCellFactory maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" activatedText="Started" deactivatedText="Stopped"/&gt;&lt;/cellFactory&gt;
        &lt;cellValueFactory&gt;&lt;PropertyValueFactory property="state"/&gt;&lt;/cellValueFactory&gt;
      &lt;/TableColumn&gt;
      &lt;TableColumn prefWidth="75.0" text="Side"&gt;
        &lt;cellValueFactory&gt;&lt;PropertyValueFactory property="side"/&gt;&lt;/cellValueFactory&gt;
      &lt;/TableColumn&gt;
      &lt;TableColumn prefWidth="75.0" text="Source"&gt;
        &lt;cellValueFactory&gt;&lt;PropertyValueFactory property="sourceContract"/&gt;&lt;/cellValueFactory&gt;
      &lt;/TableColumn&gt;
      &lt;TableColumn prefWidth="75.0" text="Reference" editable="true"&gt;
        &lt;cellFactory&gt;
          &lt;ChoiceBoxTableCellFactory maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308"&gt;
            &lt;items&gt;
              &lt;FXCollections fx:factory="observableArrayList"&gt;
                &lt;String fx:value="r01" /&gt;
                &lt;String fx:value="r02" /&gt;
              &lt;/FXCollections&gt;
            &lt;/items&gt;
          &lt;/ChoiceBoxTableCellFactory&gt;
        &lt;/cellFactory&gt;
        &lt;cellValueFactory&gt;&lt;PropertyValueFactory property="referenceContract"/&gt;&lt;/cellValueFactory&gt;
      &lt;/TableColumn&gt;
      &lt;TableColumn prefWidth="75.0" text="Destination"&gt;
        &lt;cellValueFactory&gt;&lt;PropertyValueFactory property="destinationContract"/&gt;&lt;/cellValueFactory&gt;
      &lt;/TableColumn&gt;
      &lt;TableColumn prefWidth="75.0" text="Margin" editable="true"&gt;
        &lt;cellFactory&gt;&lt;SpinnerTableCellFactory maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" min="0" max="1" initialValue="0" amountToStepBy="0.025" decimalFormat="0.000"/&gt;&lt;/cellFactory&gt;
        &lt;cellValueFactory&gt;&lt;PropertyValueFactory property="margin"/&gt;&lt;/cellValueFactory&gt;
      &lt;/TableColumn&gt;
      &lt;TableColumn prefWidth="75.0" text="Bot"&gt;
        &lt;cellValueFactory&gt;&lt;PropertyValueFactory property="bot"/&gt;&lt;/cellValueFactory&gt;
      &lt;/TableColumn&gt;
      &lt;TableColumn prefWidth="75.0" text="Price"&gt;
        &lt;cellValueFactory&gt;&lt;PropertyValueFactory property="price"/&gt;&lt;/cellValueFactory&gt;
      &lt;/TableColumn&gt;
      &lt;TableColumn prefWidth="75.0" text="Volume"&gt;
        &lt;cellValueFactory&gt;&lt;PropertyValueFactory property="volume"/&gt;&lt;/cellValueFactory&gt;
      &lt;/TableColumn&gt;
    &lt;/columns&gt;
    &lt;items&gt;
      &lt;FXCollections fx:factory="observableArrayList"&gt;
        &lt;GridRowModel state="false" side="BID" sourceContract="s01" referenceContract="r01" destinationContract="d01" margin="0" bot="MinMax" price="15.125" volume="0" /&gt;
        &lt;GridRowModel state="false" side="ASK" sourceContract="s02" referenceContract="r01" destinationContract="d02" margin="0" bot="MinMax" price="15.125" volume="0" /&gt;
      &lt;/FXCollections&gt;
    &lt;/items&gt;
  &lt;/TableView&gt;
  </code></pre>
  
  <p>The <code>ChoiceBoxTableCellFactory</code> has a constructor which takes both named arguments from the fxml and a setter for the items element.</p>
  
  <pre><code>public class ChoiceBoxTableCellFactory&lt;S, T&gt; implements Callback&lt;TableColumn&lt;S, String&gt;, TableCell&lt;S, String&gt;&gt; {
  
    private ObservableList&lt;String&gt; items;
    private double maxHeight;
    private double maxWidth;
  
    public ChoiceBoxTableCellFactory() {
    }
  
    public ChoiceBoxTableCellFactory(
      @NamedArg("maxHeight") double maxHeight,
      @NamedArg("maxWidth") double maxWidth) {
      this.maxHeight = maxHeight;
      this.maxWidth = maxWidth;
    }
  
    @Override
    public TableCell&lt;S, String&gt; call(TableColumn&lt;S, String&gt; param) {
      return new TableCell&lt;S, String&gt;() {
  
        ChoiceBox&lt;String&gt; choiceBox = new ChoiceBox&lt;&gt;(getItems());
  
        {
          choiceBox.setMaxHeight(maxHeight);
          choiceBox.setMaxWidth(maxWidth);
          choiceBox.valueProperty().addListener((obs, oldValue, newValue) -&gt; {
            ObservableValue&lt;String&gt; value = getTableColumn().getCellObservableValue(getIndex());
            if (value instanceof WritableValue) {
              ((WritableValue&lt;String&gt;) value).setValue(newValue);
            }
          });
        }
  
        @Override
        protected void updateItem(String item, boolean empty) {
          super.updateItem(item, empty);
          if (empty) {
            setText(null);
            setGraphic(null);
          } else {
            if (isEditing()) {
              setText(null);
              setGraphic(null);
            } else {
              choiceBox.setValue(item);
              setText(null);
              setGraphic(choiceBox);
            }
          }
        }
      };
    }
  
    public ObservableList&lt;String&gt; getItems() {
      return items;
    }
  
    public void setItems(ObservableList&lt;String&gt; items) {
      this.items = items;
    }
  }
  </code></pre>
  
  <p>But that throws this exception</p>
  
  <pre><code>Caused by: java.lang.IllegalArgumentException: Unable to coerce [[r01, r02]] to interface javafx.collections.ObservableList.
      at com.sun.javafx.fxml.BeanAdapter.coerce(BeanAdapter.java:496)
      at com.sun.javafx.fxml.builder.ProxyBuilder$Setter.invoke(ProxyBuilder.java:533)
      at com.sun.javafx.fxml.builder.ProxyBuilder.createObjectFromDefaultConstructor(ProxyBuilder.java:338)
      ... 144 more
  </code></pre>
  
  <p>When I remove the <code>maxHeight</code> and <code>maxWidth</code> attributes the items field is set correctly through the setter. With these attributes the items value is wrapped in an additional array. How can I achieve the desired result?</p>