Home » Eclipse Projects » Eclipse Scout » Table uses space although embracing GroupBox is not expanded(TableField/Table in GroupBox takes space when groupbox is not expanded)
|
Re: Table uses space although embracing GroupBox is not expanded [message #1711270 is a reply to message #1711259] |
Wed, 14 October 2015 09:31   |
Eclipse User |
|
|
|
Jannik Malken wrote on Wed, 14 October 2015 13:45 I hope, i'm not getting squashed for posting another question in this forum...
No problem at all. We do our best to answer the questions and everybody is welcomed.
Jannik Malken wrote on Wed, 14 October 2015 13:45Probably I'm just missing a simple property once again, but I have not been able to figure it out so far.
If you ask me, the layout-manager is at the same time one of the best and one of the worst parts of Scout.
In a lot of cases (90%) it just does something really good without having to configure anything.
But in some cases, if you have a particular requirement, it might be difficult to configure everything in order to get the desired result.
At the end it is a trade-off.
I will give you some inputs with some information. I hope it will help you to solve your problem. Do not hesitate to continue the discussion.
------
If you have only simple fields (height == 1) in your form, the layout manager works as you expect:

=> If you close the section "Second Box", you get the result you want.
By the way, the layout is grid based. You can inspect it with the Layout Debugger.

Now let change the AString field to a multiline text field:
- getConfiguredGridH returns 5
- getConfiguredGridW returns 2
- getConfiguredMultilineText returns true
By default, the Scout Layout manager tries to consume all the available space. Multiline fields (like StringField in this example or a TableField in your example) will be stretched out.

I agree with you, in case this field is inside an expandable GroupBox this is not really looking good. Because as you noticed, if the GroupBox is collapsed the unnecessary space is still present.
You can tell the MainBox of your form that it should not expand.
Add "getConfiguredFillVertical returns false" im the MainBox of your form.
For my simple example it produces the expected result:

When I now close my "Second Box" section, I get the result you expect.
|
|
|
Re: Table uses space although embracing GroupBox is not expanded [message #1711385 is a reply to message #1711270] |
Thu, 15 October 2015 08:59   |
Eclipse User |
|
|
|
Hi, Jeremie and thank you for your answer.
I've been playing around for hours now and still have no sufficient solution. Setting 'fillVertical' of the MainBox to false was a really good hint, but brings along other problems.
For some reason, only the scrollbar of my results table is visible. My tables columns are injected at runtime and the data is first loaded after initialization with reloadTableData from the outside of the class, so it could be that the table is empty when the layout manager tries to calculate the size. Setting GridH to an appropriate value, makes it bit better, but shouldn't be the last solution, as the table then always stays the same size.
Apart from that there are several other problems which would take to long to explain right now.
So I'm trying to explain what I want to achieve and maybe you could give me some more hints how to get there.



As you might see in the screenshots, I deleted the Paging GroupBox and set the ResultsTable GroupBox's expandable property to false. This way I think it's a bit easier as there is only one expandable box left and it also saves some space.
My aim is to make the table always consume the space that is visually available. So when the Filters-Box closes, the table should grow and when Filters-Box expands, the table should shrink. The Filters-Box could have a hardcoded size. Optionally it would be great if the user had the opportunity to set the space ratio between the Filters-Box and the Results-Box via a SplitBar or something like that.
I really would appreciate some quick help, but I believe it's rather a lasting tinkering exercise.
Slightly different topic: Including the help of the layout debugger, I found out that Buttons are treated in a complete other way than Labels when you put them in a GroupBox. I was not able to move the Buttons on top of the Filters table unless I put them in an additional SequenceBox. When wrapped by a SequenceBox, the layout was totally different from when I put them directly in the GroupBox: All buttons aligned to the left side; Button widths all varying depending on the label size. In comprison to that, additional labels where arranged as supposed.
I believe, I haven't properly understood the idea of the layout concept. It's quite different to common UI concepts though...
Best regards,
Jannik
[Updated on: Fri, 16 October 2015 04:59] by Moderator
|
|
| | |
Goto Forum:
Current Time: Wed May 07 06:46:01 EDT 2025
Powered by FUDForum. Page generated in 0.02951 seconds
|