Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clear() on a Select does not clear the value #842

Closed
FrankHossfeld opened this issue Sep 26, 2023 · 0 comments
Closed

clear() on a Select does not clear the value #842

FrankHossfeld opened this issue Sep 26, 2023 · 0 comments
Assignees
Labels
bug Something isn't working version 2.x.x Version 2.x.x issues
Milestone

Comments

@FrankHossfeld
Copy link
Contributor

To reproduce the error:

  • create a Select widget
  • call clear

Value is not clear.

I'll add the code where I use the clear:

   this.natuerlichePerson = SwitchButton.create(ApplicationConstantsFactory.INSTANCE.get("natuerlichePerson"),
                                                 ApplicationConstantsFactory.INSTANCE.get("no"),
                                                 ApplicationConstantsFactory.INSTANCE.get("yes"))
                                         .groupBy(grouping)
                                         .addChangeListener((oldValue, newValue) -> {
                                           if (newValue) {
                                             this.gesellschaftsform.clear();
                                             this.gesellschaftsform.hide();
                                             this.gesellschaftsform.setRequired(false);
                                           } else {
                                             this.gesellschaftsform.show();
                                             this.gesellschaftsform.setRequired(true);
                                           }
                                         });
    this.gesellschaftsform = Select.<String>create(ApplicationConstantsFactory.INSTANCE.get("gesellschaftsform"))
                                   .groupBy(grouping)
                                   .setRequired(true);
    List<SelectOption<String>> optionsList = new ArrayList<>();
    Arrays.asList(ClGesellschaftsform.values())
          .forEach(e -> optionsList.add(SelectOption.create(e.getKurzBezeichnung(),
                                                            e.getKurzBezeichnung(),
                                                            e.getBezeichnung())));
    optionsList.forEach(o -> this.gesellschaftsform.appendChild(o));

Expected result should be that the clear()-call should deselect a choosen value/ clears the selection.

@vegegoku vegegoku self-assigned this Sep 27, 2023
@vegegoku vegegoku added the bug Something isn't working label Sep 27, 2023
@vegegoku vegegoku added this to the 2.0.0-RC4 milestone Sep 27, 2023
@vegegoku vegegoku changed the title v2: clear()on a Select does not clear the value clear() on a Select does not clear the value Sep 27, 2023
@vegegoku vegegoku added the version 2.x.x Version 2.x.x issues label Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working version 2.x.x Version 2.x.x issues
Projects
Status: Done
Development

No branches or pull requests

2 participants