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

ScrollView doesn't honor unmanaged nodes, instead always resizes them

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: javafx
    • Labels:
    • Environment:

      all

      Description

      Layoutinfo.UNMANAGED not working for Button control inside ScrollView.

      Work Around for this is use - layoutInfo: LayoutInfo {width:<width> height:<height>} instead of using LayoutInfo.UNMANAGED and setting width and height directly.
      Given below the testcase:
      package scrollbarbugs;

      import javafx.scene.Scene;
      import javafx.stage.Stage;

      import com.sun.javafx.scene.control.ScrollView;
      import javafx.scene.layout.LayoutInfo;

      import javafx.scene.control.CheckBox;

      import javafx.scene.control.Button;


              var h: Number = 320;
              var w: Number = 240;
              //var httpRes = param.getString("httpRes");

              var blocksMouse = false;
              var btnOpacity = 1.0;
              var scrollViewDisable = false;
              var toggleEffect = true;
              var button = Button {
                      text: "Below ScrollView"
      layoutInfo:LayoutInfo.UNMANAGED
                      width: 155
                      height:155
                      translateX: 30
                      translateY: 65
                      opacity: bind btnOpacity
                      action: function() {
                          if(toggleEffect) {
                              btnOpacity = 0.2;
                              toggleEffect = false;
                          }
                          else {
                              btnOpacity = 1.0;
                              toggleEffect = true;
                          }
                      }


              };

              var node = Button {
                      text: "Inside"
      layoutInfo:LayoutInfo.UNMANAGED
                      width: 135
                      height:135
                      blocksMouse:false

              };
              var scrollView = ScrollView
              {
                  node: node
      layoutInfo:LayoutInfo.UNMANAGED
                  width: 120
                  height: 120
                  translateX: 10
                  translateY: 5
                  disable: bind scrollViewDisable
                  blocksMouse: bind blocksMouse
              };

              var btnCheckBox = CheckBox {
                                  translateX: 30
                                  translateY: 230
                                  text: bind "Scrollview blocksMouse {scrollView.blocksMouse}"
                                  selected: bind blocksMouse with inverse
              };
              var sVDisableCheckBox = CheckBox {
                                  translateX: 30
                                  translateY: 260
                                  text: bind "ScrollView disable {scrollView.disable}"
                                  selected: bind scrollViewDisable with inverse
              };
              Stage {
                  scene: Scene {
                      height: h;
                      width: w;
                      content: bind [ button, scrollView, btnCheckBox,sVDisableCheckBox ];
                  }
              }
              scrollView.requestFocus();

        Attachments

          Activity

            People

            • Assignee:
              miflemi Mick Fleming (Inactive)
              Reporter:
              rnairjfx Raghu K Nair (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: