Uploaded image for project: 'Blossom'
  1. Blossom
  2. BLOSSOM-151

When combine switchable field and select fields if you don't change selected option on select fields, the dialog don't save anything

    XMLWordPrintable

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

        Attachments

          Activity

            People

              tmattsson Tobias Mattsson
              ioker Francisco J. Giner
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD