3 Replies Latest reply: Jan 2, 2013 8:08 AM by 966626 RSS

    Anchor Height inside a split pane

    966626
      I have the following code in fxml:
      <SplitPane dividerPositions="0.1" fx:id="scpContenido"
      AnchorPane.bottomAnchor="0.0"
      AnchorPane.leftAnchor="0.0"
      AnchorPane.rightAnchor="0.0"
      AnchorPane.topAnchor="0.0">
      <items>
      <VBox>
      <children>
      <ComboBox fx:id="tipoDocumento" onAction="#cmbTipoDocumentoAction" prefHeight="21.0" prefWidth="138.0" VBox.vgrow="NEVER">
      <items>
      <FXCollections fx:factory="observableArrayList">
      <String fx:value="Tesis" />
      <String fx:value="Ejecutorias" />
      <String fx:value="Votos" />
      <String fx:value="Acuerdos" />
      <String fx:value="Otros" />
      <String fx:value="Sentencias de otros Tribunales" />
      <String fx:value="Octava parte: Ejecutorias" />
      <String fx:value="Octava parte: Votos" />
      <String fx:value="Novena parte: Sentencias" />
      </FXCollections>
      </items>
      <VBox.margin>
      <Insets fx:id="x1" />
      </VBox.margin>
      </ComboBox>
      <Button fx:id="btnSecuencial" mnemonicParsing="false" onAction="#btnSecuencialAction" prefHeight="21.0" prefWidth="138.0" text="%btnSecuencial" VBox.margin="$x1" VBox.vgrow="NEVER" />
      <Button fx:id="btnPorRegistro" mnemonicParsing="false" prefHeight="21.0" prefWidth="138.0" text="%btnPorRegistro" VBox.margin="$x1" VBox.vgrow="NEVER" />
      <Button fx:id="btnRecuperar" mnemonicParsing="false" prefWidth="138.0" text="%btnRecuperar" VBox.margin="$x1" VBox.vgrow="NEVER" />
      <VBox fx:id="panelBusqueda" prefHeight="295.0" prefWidth="138.0" VBox.margin="$x1" VBox.vgrow="ALWAYS" />
      </children>
      </VBox>
      <ScrollPane
      AnchorPane.topAnchor="0.0"
      AnchorPane.bottomAnchor="0.0">
      <content>
      <AnchorPane fx:id="panelesResultados"
      minWidth="800"
      minHeight="${scpContenido.height}"
      prefWidth="800">

      </AnchorPane>
      </content>
      </ScrollPane>
      </items>
      </SplitPane>
      but when i add a new child inside the "panelesResultados" anchor pane it doesn't take all the height of the left side of the plit pane... when i put a Anchorpane with a TableView inside the table view doesn't show the rows...
      The question is how to set the Anchor Pane to get all the available hight on the splitpane (or the ScrollPane)??? in order to show the table view rows.
      i don't want a fix height value since i want to be a variable height window, so the number of rows will depend on the window height..
      i hope i explained myself clear.
      Greetings and thanks in advance
        • 1. Re: Anchor Height inside a split pane
          945099
          Try this
          <ScrollPane fitToHeight="true">
             <content>
                <AnchorPane fx:id="panelesResultados"
                   minWidth="800" prefWidth="800" >
                                        
                </AnchorPane>
             </content>
          </ScrollPane>
          And why are you use AnchorPane.topAnchor="0.0" and AnchorPane.bottomAnchor="0.0" for ScrollPane, if ScrollPane is item of SplitPane?
          • 2. Re: Anchor Height inside a split pane
            966626
            What i want to modify when the windows is resized is the height, the width is responding correctly and the minWidth is to be sure that the scrollbars are showing when the split pane left less space than the width of the Anchorpane.
            i will try fittoHeight, the AnchorPane.topAchor was a desesparete try to make the things work. Thanks in advance
            • 3. Re: Anchor Height inside a split pane
              966626
              It worked great!!! thanks a lot.