Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Problem with setSplitHorizontal() in AbstractSplitBox
Problem with setSplitHorizontal() in AbstractSplitBox [message #1822197] Sat, 29 February 2020 17:00 Go to next message
Krzysztof Leja is currently offline Krzysztof LejaFriend
Messages: 55
Registered: April 2019
Member
Hi,
In my Scout 9 application I use split box field on the form.
I would like to give the user the opportunity to change the split position between vertical or horizontal. So I added a button that toggle value true/false in method setSplitHorizontal() on this field.

But running this method does nothing. The split position does not change from its default position, set with the getConfiguredSplitHorizontal() method during form initialization.

In network debug view in internet browser I see, that after clicking this button and changing the value with the setSplitHorizontal() method, nothing is sent back from the server to the browser except the field identifier, for example:
{"#":52}


Is there any simple way to force the Scout framework to make this change work?

Earlier in this forum, in a similar problem with refreshing the table header text after changing it, the following code helped:
TableEvent event = new TableEvent(table, TableEvent.TYPE_COLUMN_HEADERS_UPDATED);
event.setColumns(table.getColumns());
table.fireTableEventInternal(event);


But SplitBox do not have any fire* method.
Re: Problem with setSplitHorizontal() in AbstractSplitBox [message #1822243 is a reply to message #1822197] Mon, 02 March 2020 11:50 Go to previous messageGo to next message
Beat Schwarzentrub is currently offline Beat SchwarzentrubFriend
Messages: 214
Registered: November 2010
Senior Member
Unfortunately, changing the splitter orientation at runtime is not currently supported.

You have two options:


  1. Let the user select the desired orientation in some kind of "user settings" dialog and apply the setting when the application is restarted.
  2. If you really need the dynamic feature, you could try the following: When changing the orientation, remove and destroy the current SplitBox field from the container field, create a new instance with the changed orientation and add it to the container field again (using AbstractCompositeField#removeField(IFormField) and AbstractCompositeField#addField(IFormField)). If your split box contains value fields, you have to manually transfer all values to the new corresponding new field instances. This is not an optimal solution, since it requires quite a but of code and resources, but it should principally work.


Regards,
Beat
Re: Problem with setSplitHorizontal() in AbstractSplitBox [message #1822669 is a reply to message #1822243] Wed, 11 March 2020 08:50 Go to previous message
Krzysztof Leja is currently offline Krzysztof LejaFriend
Messages: 55
Registered: April 2019
Member
Hi Beat,
Thank you for the tips. I used the above option no. 2 and it worked!
Previous Topic:Eclipse Scout 10 JS Project Generation
Next Topic:Saving users table customisation
Goto Forum:
  


Current Time: Thu Dec 05 22:52:29 GMT 2024

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

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

Back to the top