Details
-
Bug
-
Resolution: Cannot Reproduce
-
Neutral
-
None
-
3.0
-
None
-
None
Description
When writing a TabFactory to configure a component, if combine a SwitchableField with SelectFields, when launching the configuration of the component (dialog) if you do not choose any option on the selectors, the first values of them are not saved nodes options. I tried to put defaultValue in the selectors or mark as selected the first element of the same but still without saving. An example:
@TabFactory("Content") public void contentTab(UiConfig cfg, TabBuilder tab) { List<Article> news = articleService.findAllByType("News"); List<Article> posts = articleService.findAllByType("Posts"); SelectFieldBuilder newsSelector = cfg.fields.select("news").label("Select one"); for (Article obj : news) { OptionBuilder ob = new OptionBuilder() .label(obj.getTitle()) .value(obj.getId()); newsSelector.options(ob); } SelectFieldBuilder postSelector = cfg.fields.select("posts").label("Select one"); for (Article obj : posts) { OptionBuilder ob = new OptionBuilder() .label(obj.getTitle()) .value(obj.getId()); postSelector.options(ob); } tab.fields( cfg.fields.switchable("type_object").label("Type").options( new OptionBuilder().value("news").label("News").selected(), new OptionBuilder().value("posts").label("Posts") ).fields( newsSelector, postSelector ) ); }
Checklists
Acceptance criteria