I need a method to set the required message for InputParameter created through code as below.
InputParameter.dateParameter(“scheduledDate”).withCaption(messageBundle.getMessage(“taskDate”)).withRequired(true)
Thanks,
Hari
I need a method to set the required message for InputParameter created through code as below.
InputParameter.dateParameter(“scheduledDate”).withCaption(messageBundle.getMessage(“taskDate”)).withRequired(true)
Thanks,
Hari
Hi,
The documentation shows how you can create custom input field for the InputDialog:
https://doc.cuba-platform.com/manual-7.2/gui_dialogs.html
See “Input dialog with a custom parameter:” example.
.withCaption("Enter some values")
.withParameters(
InputParameter.stringParameter("name").withCaption("Name"),
InputParameter.parameter("customer")
.withField(() -> {
LookupField<Customer> field = uiComponents.create(
LookupField.of(Customer.class));
field.setOptionsList(dataManager.load(Customer.class).list());
field.setCaption("Customer");
field.setWidthFull();
return field;
})
)
// ...
I see this, where I need to use the withField method.
It would be good if there would be direct way to make the input parameter as required, as I cannot use withFIeld method always which has some constrains.
Yes, it would be a useful API addition.
I’ve created improvement ticket: Add method InputParameter.withRequiredMessage() · Issue #331 · jmix-projects/jmix-ui · GitHub
Thanks!