Layout on Form Scout 8 [message #1799141] |
Fri, 30 November 2018 11:59 |
The Maddes Messages: 44 Registered: October 2018 |
Member |
|
|
Hello,
i have a question about the layouting of a form.
This form is attached on a tablepage as a detailform.
What i need to have is, that all fields are in the left side of the form.
So like you see in the picture, that box 3 and box 4 should be positioned under box 2, so that all boxes are positioned on the left side and the right side is just plain empty. Is this possible?
At the moment my code (simplified for layout) looks like that:
@Order(1000)
@ClassId("e87975bc-28d4-4912-834a-aeca15209dae")
public class MainBox extends AbstractGroupBox {
@Override
protected int getConfiguredGridColumnCount() {
return 2;
}
public class GeneralBox extends AbstractGroupBox {
@Override
protected int getConfiguredGridW() {
return 1;
}
@Override
protected double getConfiguredGridWeightY() {
// do not allow the general box to grow or shrink vertically.
return 0;
}
public class Box1Box extends AbstractGroupBox {
@Override
protected int getConfiguredGridW() {
return 1;
}
public class Field1Field extends AbstractDateField { }
public class Field2Field extends AbstractSmartField<Long> { }
}
public class Box2Box extends AbstractGroupBox {
@Override
protected int getConfiguredGridW() {
return 1;
}
public class Field3Field extends AbstractBigDecimalField { }
public class Field4Field extends AbstractBigDecimalField { }
}
public class Box3Box extends AbstractGroupBox {
@Override
protected int getConfiguredGridW() {
return 1;
}
public class Button1 extends AbstractButton { }
public class Button2 extends AbstractButton { }
}
public class Box4Box extends AbstractGroupBox {
@Override
protected int getConfiguredGridW() {
return 1;
}
public class Field5Field extends AbstractStringField {}
)
public class Field6Field extends AbstractStringField {
@Override
protected int getConfiguredGridH() {
return 2;
}
}
}
}
public class OkButton extends AbstractOkButton {
@Override
protected int getConfiguredSystemType() {
return SYSTEM_TYPE_SAVE;
}
@Override
protected String getConfiguredLabel() {
return TEXTS.get("SaveEntry");
}
}
}
So i think it will be an easy fix, but i just dont get where to make the definitions needed. Tried with different column counts, weights, added empty boxes as buffers...nothing worked out.
Thank you.
[Updated on: Fri, 30 November 2018 11:59] Report message to a moderator
|
|
|
Re: Layout on Form Scout 8 [message #1799153 is a reply to message #1799141] |
Fri, 30 November 2018 14:53 |
Patrick Baenziger Messages: 96 Registered: September 2011 |
Member |
|
|
Sure, that should be possible.
You can make a "left group box" and a "right group box" directly inside the main box. Make each of them 1 Unit wide. If you want, hide the border and label of the group boxes (left and right).
Make sure the main group box has a column count of 2 (should be the default).
Then add your boxes to the left group box only and you're almost done.
Now the trick: Since the right box would be empty (for now), Scout would remove it. To prevent this, add a PlaceholderField (AbstractPlaceholderField, or empty LabelField) to the right group box.
MainBox
+---------------------------------------------------------------------+
| getConf...ColumnCount=2 |
| |
| LeftBox RightBox |
| +-----------------------+ +------------------------+ |
| | g.C.GridW=1 | | g.C.GridW=1 | |
| | | | | |
| | | | | |
| | +-------------------+ | | +----------------+ | |
| | | Box1 | | | | Placeholder | | |
| | +-------------------+ | | +----------------+ | |
| | | | | |
| | +-------------------+ | | | |
| | | Box2 | | | | |
| | +-------------------+ | | | |
| | | | | |
| | +-------------------+ | | | |
| | | Box3 | | | | |
| | +-------------------+ | | | |
| | | | | |
| | +-------------------+ | | | |
| | | Box4 | | | | |
| | +-------------------+ | | | |
| | | | | |
| +-----------------------+ +------------------------+ |
| |
+---------------------------------------------------------------------+
[Updated on: Fri, 30 November 2018 14:55] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02708 seconds