Dear Alejandro Duarte, Thank you so much for your amazing work. Crud UI is

Dear Alejandro Duarte,
Thank you so much for your amazing work. Crud UI is really an amazing Add-on which saves a lot of time. I am a new user of Crud UI Add-on. So ,I am facing some difficulties. Would you please give me suggestions about solving the following problems.

I have to make the following properties visible in the form during the add operation.

formFactory.setVisibleProperties(CrudOperation.ADD, "entryDateTime", "stockOperation", "storageLocation","quantity","toLocation",);

Here, stockOperation and toLocation porperty provide combobox. But the condition is toLocation Combobox will show only when a particular option will be choosen in stockOperation. I mean, I need to show or hide the toLocation combobox dynamically which dependes on stockOperation combobox.

The options of stockOperation comes from a enum and here is the fieldProvider of toLocation

formFactory.setFieldProvider("toLocation", () -> {
            ComboBox<StorageLocation> storageLocationComboBox = new ComboBox<>();
            storageLocationComboBox.setItemLabelGenerator(storageLocation -> storageLocation.getLocation().getName() + " - " + storageLocation.getName());
            storageLocationComboBox.setItems(storageLocationService.findAll());
            return storageLocationComboBox;
        });

Hi and thanks for the feedback! It’s always good to hear that the add-on is useful.

You can create the instances outside the field provider and then “play” with them as you wish. for example:

var field1 = new ComboBox<Entity1>();
var field2 = new ComboBox<Entity2>(); // can be hidden later

formFactory.setFieldProvider("entity1", () -> field1);
formFactory.setFieldProvider("entity2", () -> field2);

field1.addValueChangeListener(event -> {
  ...
  boolean isVisible = field1.getValue().equals(someValue);
  field2.setVisible(isVisible);
});