Closed LaChope closed 7 months ago
Options to implement validation in Record Manager UI:
SForms.validate()
1)
this.refForm = React.createRef(); this.refForm.current.validate(evaluateCompleteness = false);
BTW, RecordForm has state isValid.
RecordForm
isValid
It is possible to think about implementation of generic visitor of all questions (would be used for both, getting list of invalid/incomplete questions and changing "in/valid" state of questions)
process_question: (question) => object
Example of processors:
showRequiredToSave(question) { question.validate(); }
collectRequiredToSave(question) { if not_valid(question) { listOfFailedQuestions.add(question) } }
2) It would be something like <SForms showAllInvalid=true/> and <SForms showAllIncomplete=true/>.
<SForms showAllInvalid=true/>
<SForms showAllIncomplete=true/>
Originally posted by @blcham in https://github.com/kbss-cvut/record-manager-ui/issues/101#issuecomment-1993862218
Options to implement validation in Record Manager UI:
1) implement a specific method like
SForms.validate()
2) implement as properties of SForms1)
BTW,
RecordForm
has stateisValid
.It is possible to think about implementation of generic visitor of all questions (would be used for both, getting list of invalid/incomplete questions and changing "in/valid" state of questions)
process_question: (question) => object
Example of processors:
2) It would be something like
<SForms showAllInvalid=true/>
and<SForms showAllIncomplete=true/>
.Originally posted by @blcham in https://github.com/kbss-cvut/record-manager-ui/issues/101#issuecomment-1993862218