Interface MandatoryAwareFormQuestionType

All Known Implementing Classes:
AbstractFormQuestionType, CheckBoxQuestionType, ChoicesListQuestionType, DateTimeQuestionType, FileQuestionType, MatrixQuestionType, NumberQuestionType, SimpleTextQuestionType, TextAreaQuestionType

Provide all the necessary method to make a question type required or not
  • Field Details

  • Method Details

    • getMandatoryModelItem

      Get the model item to add to the model items return by the method FormQuestionType.getModel
      Returns:
      the model item
    • getMandatoryViewElement

      Create a view element to add in the view elements returned by FormQuestionType.getView
      Parameters:
      model - the model link to the view
      Returns:
      a view element
    • getMandatoryValidator

      Create a validator that should be added to the element definition return by FormQuestionType.getEntryModel
      Parameters:
      question - the question
      Returns:
      a validator
    • isMandatory

      default boolean isMandatory(FormQuestion question)
      Check if the question is actually mandatory
      Parameters:
      question - the question to check
      Returns:
      true if the question is mandatory