Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » SequenceBox and LABEL_POSITION_TOP in containing fields
SequenceBox and LABEL_POSITION_TOP in containing fields [message #1841880] Wed, 02 June 2021 06:30 Go to next message
Nils Israel is currently offline Nils IsraelFriend
Messages: 72
Registered: May 2010
Member
Hi,
we are using LABEL_POSITION_TOP as a default for all our form fields. For custom widgets we are using sequence boxes with containing fields as templates. https://www.eclipse.org/forums/index.php/t/1107790/

To get a label on top of each containing field I set the label of the sequence box to not visible and use the labels of the containing fields.
The problem is that the height of the sequence box is not calculated correctly.

To reproduce the problem I started a new scout application from scratch and put the following groupbox in the Hello World form.

index.php/fa/40573/0/

    @Order(1000)
    public class TopBox extends AbstractGroupBox {

      @Override
      protected int getConfiguredGridColumnCount() {
        return 1;
      }

      @Order(1000)
      public class Demo1Box extends AbstractSequenceBox {

        @Override
        protected boolean getConfiguredLabelVisible() {
          return false;
        }

        @Order(1000)
        public class Field1Field extends AbstractStringField {
          @Override
          protected String getConfiguredLabel() {
            return "Label A";
          }

          @Override
          protected byte getConfiguredLabelPosition() {
            return LABEL_POSITION_TOP;
          }
        }

        @Order(2000)
        public class Field2Field extends AbstractStringField {
          @Override
          protected String getConfiguredLabel() {
            return "Label B";
          }

          @Override
          protected byte getConfiguredLabelPosition() {
            return LABEL_POSITION_TOP;
          }
        }
      }

      @Order(2000)
      public class Demo2Box extends AbstractSequenceBox {

        @Override
        protected boolean getConfiguredLabelVisible() {
          return false;
        }

        @Order(1000)
        public class Field3Field extends AbstractStringField {
          @Override
          protected String getConfiguredLabel() {
            return "Label C";
          }

          @Override
          protected byte getConfiguredLabelPosition() {
            return LABEL_POSITION_TOP;
          }
        }

        @Order(2000)
        public class Field4Field extends AbstractStringField {
          @Override
          protected String getConfiguredLabel() {
            return "Label D";
          }

          @Override
          protected byte getConfiguredLabelPosition() {
            return LABEL_POSITION_TOP;
          }
        }
      }
    }


Is this a bug or am I using the labels in a not intended way?
Thanks.
Nils
Re: SequenceBox and LABEL_POSITION_TOP in containing fields [message #1841883 is a reply to message #1841880] Wed, 02 June 2021 07:00 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 256
Registered: March 2010
Senior Member
Hi Nils,

each field with gridH = 1 in the logical grid of a group box has a fixed height of 30px. If the label is set to top the height is automatically increased by the height of the label.
The same applies for a sequence box. Since the label of the sequence box itself is not visible, the height is 30px. To increase the height, you can tell the sequence box to be as height as its content. This is what other containers like the group box do as well. To do so, just set the property gridDataHints.useUiHeight to true.

@Override
protected boolean getConfiguredGridUseUiHeight() {
  return true;
}
Re: SequenceBox and LABEL_POSITION_TOP in containing fields [message #1841888 is a reply to message #1841883] Wed, 02 June 2021 10:47 Go to previous message
Nils Israel is currently offline Nils IsraelFriend
Messages: 72
Registered: May 2010
Member
Thanks Claudio, that's working perfectly.
Previous Topic: Could not find "HeatmapFieldAdapter" in namespace ""
Next Topic:heatmap isn't displayed correctly
Goto Forum:
  


Current Time: Wed May 08 10:14:20 GMT 2024

Powered by FUDForum. Page generated in 0.04026 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top