Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8104659

An input widget with an attribute that has no "with inverse" bind had better to be disabled than throwing an exception when an app is launched.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Withdrawn
    • Icon: P3 P3
    • fx2.0
    • None
    • javafx
    • XP/JDK6U3


      When an attribute of the input widget is bounded without "with inverse", it means user can't change the input attribute. So it would make sense to disable and show the widget rather than throwing an USOE exception when an application is launched. If it's not allowed, the compiler should catch the input widget attribute without "with inverse" and make it fail at the compile time. If it's not allowed so "with inverse" has to be used always together, this would be error-prone. Please think about not requiring "with inverse" for the attributes of the input widgets just like what the interpreter version did for these cases.
      I attached a test case.

      Caused by: java.lang.UnsupportedOperationException
              at com.sun.javafx.runtime.location.AbstractDoubleLocation.setAsDouble(AbstractDoubleLocation.java:58)
              at javafx.ui.ListBox.createView$impl(ListBox.fx:622)
              at javafx.ui.ListBox.createView(ListBox.fx:50)
              at javafx.ui.ScrollableWidget.createComponent$impl(ScrollableWidget.fx:239)
              at javafx.ui.ListBox.createComponent(ListBox.fx:50)
              at javafx.ui.Widget.getComponent$impl(Widget.fx:613)
              at javafx.ui.ListBox.getComponent(ListBox.fx:50)
              at javafx.ui.Frame.setContentPane$impl(Frame.fx:311)
              at javafx.ui.Frame.setContentPane(Frame.fx:46)
              at javafx.ui.Frame$11.onChange(Frame.fx:77)
              at javafx.ui.Frame$11.onChange(Frame.fx:76)
              at com.sun.javafx.runtime.location.AbstractObjectLocation.notifyListeners(AbstractObjectLocation.java:95)
              at com.sun.javafx.runtime.location.AbstractObjectLocation.fireInitialTriggers(AbstractObjectLocation.java:122)
              at com.sun.javafx.runtime.InitHelper.initialize(InitHelper.java:51)
              at javafx.ui.Frame.initialize$(Frame.fx:46)
              at test.javafx$run$(test.fx:5)
              ... 13 more

        1. test.fx
          0.4 kB
          Bae-chul Kim

            rbair Richard Bair (Inactive)
            bkimsunw Bae-chul Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: