V14 Add InValid attribute to umb-property #16934
Replies: 2 comments 1 reply
-
Hi @rsoeteman I'm happy to see the interest in utilizing the Property Editors as part of your own UI. We have just wrapped up the core features of the Validation System for v.14, which includes the features you are looking for. This brings a Validation Context that you instantiate, then all Property Editors will automatically connect their Validation state to it. And there by you can just ask the Validation Context for the Validity before submitting a form. Your case is though a little bit more complex, if I read your message correctly. I understand you want to append validation states to the editors from external code. Like server validation? or some general form validation? The system supports for that as well, but that part of the system is based on Validation Messages, implementing this requires a little of your Property implementation. Each Property must then be given a Data Path. Such defines where the value of the Property Editors goes in the Data Model. and is used to target a validation message. A Data Path is based on JSON Path and could be as simple as this: With that defined you can add messages to the validation system, using the given data path, and then it will automatically be bond to the Property Editor. So they appear invalid. The feature comes as part of 14.3 and the documentation is in the making. — I hope you find the system useful for your case, if not please let me know. Until the feature and documentation is available I will close this discussion, but please re-open or start a new one if there is a case that the system does not cover very well. Thanks in advance |
Beta Was this translation helpful? Give feedback.
-
Hi Niels, Great to hear and really looking forward to some documentation on that :-) In My case it could be some general form validation (mostly) but seen on content validation that validation is done server side as well so think in the end it doesn't matter when this feature is completed? If you need a test bunny for the feauture let me know :-) Thanks! |
Beta Was this translation helpful? Give feedback.
-
I am using the technique in this article from Matt https://dev.to/mattbrailsford/reusing-umbraco-properties-in-umbraco-v14-15b7 All works nice but when I validate my Form there is no way I can tell to the umb-property element the element is invalid (like when you save content etc) I hope for a new release an Attribute inValid can be added and that it behaves in the UI exactly as the umb-property-layout element
Beta Was this translation helpful? Give feedback.
All reactions