You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Validation error messages, such as may not be null, often lack context about the specific attribute causing the issue. This makes it difficult for developers to identify and fix the problem.
Example:
A Customer entity has the following fields:
name (@NotNull)
birthday (@NotNull)
In the corresponding detail view, the birthday field is mistakenly not added to the UI. When attempting to save a new customer, the validation fails because birthday is not set. However, the error message shown is:
may not be null
This message does not indicate that the issue is with the birthday field.
Additionally, similar issues can occur with other validation errors, not just @NotNull.
Steps To Reproduce
Create a Customer entity:
@Entity
public class Customer {
@NotNull
private String name;
@NotNull
private LocalDate birthday;
// Getters and setters
}
Generate an edit screen for the Customer entity.
Remove the birthday field from the view.
Attempt to save a new customer by filling in only the name field.
Current Behavior
The application shows a generic error message:
may not be null
This message does not specify the attribute causing the issue.
Expected Behavior
The validation error message should include the specific attribute, such as:
Birthday may not be null
This would make it easier for developers to identify and fix the problem.
Environment
Jmix version: 2.4.2
Bug Description
Validation error messages, such as
may not be null
, often lack context about the specific attribute causing the issue. This makes it difficult for developers to identify and fix the problem.Example:
A
Customer
entity has the following fields:name
(@NotNull
)birthday
(@NotNull
)In the corresponding detail view, the
birthday
field is mistakenly not added to the UI. When attempting to save a new customer, the validation fails becausebirthday
is not set. However, the error message shown is:This message does not indicate that the issue is with the
birthday
field.Additionally, similar issues can occur with other validation errors, not just
@NotNull
.Steps To Reproduce
Customer
entity:Customer
entity.birthday
field from the view.name
field.Current Behavior
The application shows a generic error message:
This message does not specify the attribute causing the issue.
Expected Behavior
The validation error message should include the specific attribute, such as:
This would make it easier for developers to identify and fix the problem.
Sample Project
jmix-problem-error-message.zip
The text was updated successfully, but these errors were encountered: