Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » (Really) dynamic form fields?(Is it possible to generate new field depending on some user input, e.g. at SmartField?)
(Really) dynamic form fields? [message #703425] Wed, 27 July 2011 15:01 Go to next message
Beat Schwarzentrub is currently offline Beat SchwarzentrubFriend
Messages: 202
Registered: November 2010
Senior Member
Hello

Is it possible to create form fields on the fly, when form is already open?

I am aware of the method AbstractCompositeField.injectFieldsInternal(List<IFormField>), but this method is only executed once during the initialization of the GroupBox. In my case, the number and the type of fields to inject is not known at that time. There is a SmartField on the form and when the user chooses a value from it, a service is called that then returns a list of field descriptions. These field descriptions should then be transformed to form fields inside a group box.

It is my current understanding that this is not possible. Can someone please confirm that, or give an example how it could be done? (Current workaround: Generate a sufficiently large bunch of fields for each type and make only those visible that are needed, change labels etc... But that's not really dynamic, is it?)

Thank you very much.

B.
Re: (Really) dynamic form fields? [message #718604 is a reply to message #703425] Wed, 24 August 2011 20:06 Go to previous messageGo to next message
Adrian MoserFriend
Messages: 67
Registered: March 2011
Member
Hi Beat

What about using a table on that form with an editable column, and another column for the field label? It is possible to create a field of any type in the cell when it is edited. And since it is a table, you can have unlimited rows (with fields).

Adrian
Re: (Really) dynamic form fields? [message #1711017 is a reply to message #718604] Mon, 12 October 2015 11:23 Go to previous messageGo to next message
Jannik Malken is currently offline Jannik MalkenFriend
Messages: 44
Registered: October 2015
Member
Hi,
since on the one hand the answers in this thread aren't very verbose and on the other hand this thread is already 5 years old, could someone please explain a little bit more detailed, how you can achieve a dynamic form with a table?
I am particularly interested in how to add smartfields or checkboxes dynamically to table fields.
In the end I would like to have a form to build structured queries for elasticsearch (influenced by elasticsearch-head).
You should be able to add multiple filter rows in which one can select a table column and some search criteria.
So in the table should look something like this (maybe with additional column headings):
index.php/fa/23512/0/
screenshot: elasticsearch-head structured query

[Updated on: Wed, 14 October 2015 11:46]

Report message to a moderator

Re: (Really) dynamic form fields? [message #1711254 is a reply to message #1711017] Wed, 14 October 2015 11:08 Go to previous message
Jannik Malken is currently offline Jannik MalkenFriend
Messages: 44
Registered: October 2015
Member
Hi,
I'm still trying to implement dynamic forms in my Scout application...

Is it somehow possible to put whole FormFields (also Container elements like SequenceBoxes) in a table cell? Thereby you would be very flexible and each row of the table could contain a variable number of fields. You could predefine FormFields an add instances of it to the table. Would be very nice...
Instead, the obvious approach to use different columns (SmartColumns, StringColumns, BooleanColumns) , is also very static as you are not able to change the number of elements from row to row.

Another benefit of FormFields in cells would be enhanced capability of changing the rendering/style of the elements. I don't like that the table cells only have this tiny 'editable' hint icon in the upper left corner and their actual content is only visible when the cell is clicked.

As a test I tried to put a SequenceBox with a Button as VALUE in a parametrized AbstractColumn<SequenceBox> cell. It works fine without any problems, but as supposed, there is no magic renering the elements in the table view. Crying or Very Sad

So guys, please help us to understand, how it is possible to achieve (really) dynamic forms with Scout. There has to be some workaround or even built-in feature that we are missing.

[Updated on: Wed, 14 October 2015 11:11]

Report message to a moderator

Previous Topic:SWT: Alignment of icons in table columns
Next Topic:Mars SR1 - new errors about "Chainable methods"
Goto Forum:
  


Current Time: Thu Mar 28 17:42:17 GMT 2024

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

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

Back to the top