Drop-down list box with constant content
6 posts
• Page 1 of 1
Drop-down list box with constant content
Hello,
I want to put a drop-down list box into a workscreen, with no link to a databook. The values of the list box are a fix set of string literals. I cannot figure out how to do that properly. Could you please help me with this?
Thank you!
Best regards,
Andreas
I want to put a drop-down list box into a workscreen, with no link to a databook. The values of the list box are a fix set of string literals. I cannot figure out how to do that properly. Could you please help me with this?
Thank you!
Best regards,
Andreas
- ANH
- Posts: 11
- Joined: Fri Jun 29, 2018 11:42 am
Re: Drop-down list box with constant content
The doc system has an article for your problem: Custom linked cell editors
-
Support@SIB - Posts: 353
- Joined: Mon Sep 28, 2009 1:56 pm
Re: Drop-down list box with constant content
Thank you for your reply.
I still have difficulties to understand how to add the UIEnumCellEditor to a panel or a workscreen. The add-functions require an IComponent as argument, but UIEnumCellEditor is not an implementation of ICompoment.
I still have difficulties to understand how to add the UIEnumCellEditor to a panel or a workscreen. The add-functions require an IComponent as argument, but UIEnumCellEditor is not an implementation of ICompoment.
- ANH
- Posts: 11
- Joined: Fri Jun 29, 2018 11:42 am
Re: Drop-down list box with constant content
Yes, that is because it isn't a component, it is a cell editor. Cell editors are set on the DataType of the column and then picked up and used automatically by the UIEditors.
See this explanation on what cell editors are for further details.
See this explanation on what cell editors are for further details.
-
rzenz - Posts: 36
- Joined: Mon Dec 12, 2016 1:40 pm
- Location: Vienna, Austria
Re: Drop-down list box with constant content
You could use a DataBook or a Row for the editor, e.g.:
... and with a DataBook, e.g.:
UIEnumCellEditor cellEditor = new UIEnumCellEditor();
cellEditor.setAllowedValues(new String[] { "A", "B", "C", "D" });
cellEditor.setDisplayValues(new String[] { "Alpha", "Bravo", "Charlie", "Delta" });
DataRow row = new DataRow();
row.getRowDefinition().addColumnDefinition(new ColumnDefinition("BASE",
new StringDataType(cellEditor)));
IEditor editor = new UIEditor(row, "BASE");
panel.add(editor);
cellEditor.setAllowedValues(new String[] { "A", "B", "C", "D" });
cellEditor.setDisplayValues(new String[] { "Alpha", "Bravo", "Charlie", "Delta" });
DataRow row = new DataRow();
row.getRowDefinition().addColumnDefinition(new ColumnDefinition("BASE",
new StringDataType(cellEditor)));
IEditor editor = new UIEditor(row, "BASE");
panel.add(editor);
... and with a DataBook, e.g.:
-
Support@SIB - Posts: 353
- Joined: Mon Sep 28, 2009 1:56 pm
Re: Drop-down list box with constant content
Thank you. The code examples together with "...and then picked up and used automatically by the UIEditors" made it clear to me.
Best regards
Andreas
Best regards
Andreas
- ANH
- Posts: 11
- Joined: Fri Jun 29, 2018 11:42 am
6 posts
• Page 1 of 1