uk.gov.hmrc.govukfrontend.views.viewmodels.charactercount
CharacterCount
Companion object CharacterCount
case class CharacterCount(id: String = "", name: String = "", rows: Int = 5, value: Option[String] = None, maxLength: Option[Int] = None, maxWords: Option[Int] = None, threshold: Option[Int] = None, label: Label = Label(), hint: Option[Hint] = None, errorMessage: Option[ErrorMessage] = None, formGroup: FormGroup = FormGroup.empty, classes: String = "", attributes: Map[String, String] = Map.empty, countMessageClasses: String = "", charactersUnderLimitText: Option[Map[String, String]] = None, charactersAtLimitText: Option[String] = None, charactersOverLimitText: Option[Map[String, String]] = None, wordsUnderLimitText: Option[Map[String, String]] = None, wordsAtLimitText: Option[String] = None, wordsOverLimitText: Option[Map[String, String]] = None, textareaDescriptionText: Option[String] = None) extends Product with Serializable
Parameters to GovukCharacterCount Twirl template
- id
the id of the
textareaelement- name
the name of the
textareaelement- rows
height of the
textareain rows- value
optional initial value of the
textarea- maxLength
optional maximum length, in characters, of the text in the
textarea- maxWords
optional maximum number of words in the
textarea- threshold
optional threshold, in characters, for the
textarea- label
optional
Labelfor the control- hint
optional
Hintfor the control- errorMessage
optional
ErrorMessageto display- formGroup
additional CSS classes/attributes/etc. to apply to the form group
- classes
optional additional CSS classes to apply to the
textarea- attributes
optional additional HTML attributes to apply to the
textarea- countMessageClasses
optional additional CSS classes to apply to the max length/word count message
- charactersUnderLimitText
optional text to display when the character count is under the limit (defaults to "You can enter up to {maxLength} characters")
- charactersAtLimitText
optional text to display when the character count is at the limit
- charactersOverLimitText
optional text to display when the character count is over the limit
- wordsUnderLimitText
optional text to display when the word count is under the limit (defaults to "You can enter up to {maxWords} words")
- wordsAtLimitText
optional text to display when the word count is at the limit
- wordsOverLimitText
optional text to display when the word count is over the limit
- textareaDescriptionText
optional text to display under the textarea
- Alphabetic
- By Inheritance
- CharacterCount
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new CharacterCount(id: String = "", name: String = "", rows: Int = 5, value: Option[String] = None, maxLength: Option[Int] = None, maxWords: Option[Int] = None, threshold: Option[Int] = None, label: Label = Label(), hint: Option[Hint] = None, errorMessage: Option[ErrorMessage] = None, formGroup: FormGroup = FormGroup.empty, classes: String = "", attributes: Map[String, String] = Map.empty, countMessageClasses: String = "", charactersUnderLimitText: Option[Map[String, String]] = None, charactersAtLimitText: Option[String] = None, charactersOverLimitText: Option[Map[String, String]] = None, wordsUnderLimitText: Option[Map[String, String]] = None, wordsAtLimitText: Option[String] = None, wordsOverLimitText: Option[Map[String, String]] = None, textareaDescriptionText: Option[String] = None)
- id
the id of the
textareaelement- name
the name of the
textareaelement- rows
height of the
textareain rows- value
optional initial value of the
textarea- maxLength
optional maximum length, in characters, of the text in the
textarea- maxWords
optional maximum number of words in the
textarea- threshold
optional threshold, in characters, for the
textarea- label
optional
Labelfor the control- hint
optional
Hintfor the control- errorMessage
optional
ErrorMessageto display- formGroup
additional CSS classes/attributes/etc. to apply to the form group
- classes
optional additional CSS classes to apply to the
textarea- attributes
optional additional HTML attributes to apply to the
textarea- countMessageClasses
optional additional CSS classes to apply to the max length/word count message
- charactersUnderLimitText
optional text to display when the character count is under the limit (defaults to "You can enter up to {maxLength} characters")
- charactersAtLimitText
optional text to display when the character count is at the limit
- charactersOverLimitText
optional text to display when the character count is over the limit
- wordsUnderLimitText
optional text to display when the word count is under the limit (defaults to "You can enter up to {maxWords} words")
- wordsAtLimitText
optional text to display when the word count is at the limit
- wordsOverLimitText
optional text to display when the word count is over the limit
- textareaDescriptionText
optional text to display under the textarea
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val attributes: Map[String, String]
- val charactersAtLimitText: Option[String]
- val charactersOverLimitText: Option[Map[String, String]]
- val charactersUnderLimitText: Option[Map[String, String]]
- val classes: String
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- val countMessageClasses: String
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val errorMessage: Option[ErrorMessage]
- val formGroup: FormGroup
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- val hint: Option[Hint]
- val id: String
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val label: Label
- val maxLength: Option[Int]
- val maxWords: Option[Int]
- val name: String
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val rows: Int
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- val textareaDescriptionText: Option[String]
- val threshold: Option[Int]
- val value: Option[String]
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- val wordsAtLimitText: Option[String]
- val wordsOverLimitText: Option[Map[String, String]]
- val wordsUnderLimitText: Option[Map[String, String]]
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)