Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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)
Table uses space although embracing GroupBox is not expanded [message #1711259] Wed, 14 October 2015 11:45 Go to next message
Jannik Malken is currently offline Jannik MalkenFriend
Messages: 44
Registered: October 2015
Member
Hi,

I hope, i'm not getting squashed for posting another question in this forum...

Filters-GroupBox closed:
index.php/fa/23530/0/
Filters-GroupBox expanded:
index.php/fa/23531/0/

As you see above, one of my problems is, that GroupBoxes that contain a TableField take almost the same space when they are not expanded as when they are expanded. I want to have a behaviour similar to that of an accordeon panel with expandable GroupBoxes.
With 'normal' fields this approach works: For example, if the page navigation GroupBox is closed, the filters GroupBox moves up since the space of the controls in the GroupBox is released.
In contrast, GroupBoxes containing Tables always take a lot of blank space although they are closed. The same happens with the 'Query Results'-GroupBox at the bottom.
Probably I'm just missing a simple property once again, but I have not been able to figure it out so far.
Re: Table uses space although embracing GroupBox is not expanded [message #1711270 is a reply to message #1711259] Wed, 14 October 2015 13:31 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
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:45
Probably 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:
index.php/fa/23532/0/
=> 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.
index.php/fa/23533/0/

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.

index.php/fa/23534/0/

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:

index.php/fa/23535/0/

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 12:59 Go to previous messageGo to next message
Jannik Malken is currently offline Jannik MalkenFriend
Messages: 44
Registered: October 2015
Member
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.

index.php/fa/23549/0/
index.php/fa/23547/0/
index.php/fa/23550/0/

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 08:59]

Report message to a moderator

Re: Table uses space although embracing GroupBox is not expanded [message #1711445 is a reply to message #1711385] Fri, 16 October 2015 07:48 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
I will not defend the LayoutManager from Scout here. I think I partially share your opinion. As I have tried to explain, it is how it is with its benefit and problems (some stuff is partially historically grown). I think that most of the Scout Users have learned to take the best of it.

Another property I did not explain in my previous message is GridWeight (GridWeightY for the vertical direction and GridWeightX for the horizontal direction). When the MainBox allows the field to be stretched ("getConfiguredFillVertical returns true" - this is the default), with the GridWeight properties you can influence how the multiline fields will consume the available space.

In my new example, I have two multiline fields. I have set GridWeightY like this:
* AString: "getConfiguredGridWeightY returns 0.0" (none of the available space will be consumed)
* My second String Field: "getConfiguredGridWeightY returns 1.0" (all of the available space will be consumed)

I think this is what you want:
index.php/fa/23560/0/
index.php/fa/23561/0/

For your buttons question, please check theses topics (I try to keep one subject by forum thread):
* Button width and style
* Problems layouting buttons on form
Re: Table uses space although embracing GroupBox is not expanded [message #1711450 is a reply to message #1711385] Fri, 16 October 2015 08:36 Go to previous message
Jannik Malken is currently offline Jannik MalkenFriend
Messages: 44
Registered: October 2015
Member
So, I somewhat figured out how to get near to the desired behaviour using the WeightH property (MainBox fillVertical is set true).
Then I wanted to get a step further and added a SplitBox where I put the Filters and Results Box in and tried to apply the weight configurations.
Unfortunately, the weight settings seem useless since the split bar never changes unless the user does. Is there a way to convince the layout manager to adjust the split position according to the weights?
It's basically the same problem again:
1. the split bar should move up the whole free space if the FiltersBox is closed.
2. the table cell should extend over the complete space
Otherwise the split bar should be located at the position that is configured by default or by the user at runtime.
Actually quite an easy use case, isn't it? Still, I'm kind of to stupid... Embarrassed

Edit: Just seen your answer. This is the exact solution I figured out. Still, doing this with a SplitBox is pain in the butt.

[Updated on: Fri, 16 October 2015 08:55]

Report message to a moderator

Previous Topic:Mars SR1 - new errors about "Chainable methods"
Next Topic:[Blog Post] Use the latest (neon) version of the formatter with mars
Goto Forum:
  


Current Time: Fri Apr 19 21:30:03 GMT 2024

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

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

Back to the top