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

Support ECProperty value range #779

Open
FelixGirard opened this issue Nov 14, 2024 · 3 comments · Fixed by iTwin/imodel-native#963 or iTwin/itwinjs-core#7534 · May be fixed by #834
Open

Support ECProperty value range #779

FelixGirard opened this issue Nov 14, 2024 · 3 comments · Fixed by iTwin/imodel-native#963 or iTwin/itwinjs-core#7534 · May be fixed by #834
Assignees
Labels
enhancement New feature or request presentation

Comments

@FelixGirard
Copy link

ECProperty supports adding constraints to values.
https://www.itwinjs.org/bis/ec/ec-property/#additional-optional-attributes

These are not enforced by the ECDb.
They should be enforced by the inputs in the property grid.

To query those, you can use the meta.ECPropertyDef table

@grigasp grigasp added the enhancement New feature or request label Nov 14, 2024
@grigasp
Copy link
Member

grigasp commented Nov 15, 2024

These are not enforced by the ECDb.

@ColinKerr, while I totally agree that editors should respect these attributes for users' convenience, I also think that ECDb should make sure to validate values against them as well.

@JonasDov
Copy link
Contributor

JonasDov commented Jan 9, 2025

@FelixGirard, we can enforce the values, but we were wondering how and when do you expect for users to be notified about the constrains?
Should the user be notified when: changing input value / submitting the input / opening the input?
How should the notification look like: alert, tooltip or something else?
For example:
let's say property is of int type, and the minimumValue is set to 3 and maximumValue is set to 30. User tries to enter:

  • 25, should the user be notified about the constrains after entering the first digit 2?
  • 33, how should the user be notified about his invalid input?
    If no notification would be shown, user would be confused about the value changing.

@FelixGirard
Copy link
Author

Honestly I just wanted them to be enforced, I was thinking just putting them in the html attributes for the inputs.
I would probably start with that, we can always add more information after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request presentation
Projects
None yet
3 participants