From wiki.ginstr.com
Jump to: navigation, search

RequiredValidator

Description
Widgets that have this feature in use are required to have an entry.
If there is no entry, Screen validation will fail if it is activated and user won’t be able to proceed with an action conditioned by validation.

Attributes

Attribute Description
message Defines message to be displayed when validation fails

Can be

  • valid target that contains text datatype
gn:minRequiredItems Defines minimum amount of items in widget: (milestone 101)

Can be

  • hardcoded integer not negative and bigger than 0
  • valid target that contains integer not negative and bigger than 0
MINREQUIREDErrMsg Defines error message for minimum required items fail: (milestone 101)

Can be

  • valid target that contains text datatype
labelTextResourceId Defines label resource which will be added to validator string at location of reserved token ${labelTextResourceId}

Can be

  • valid target that contains text datatype

Reserved tokens

In @string resources that are used for validator messages it's possible to use special tokens (reserved words). Token will be replaced by actual value during runtime of ginstr app.

For RequiredValidator
  • ${labelTextResourceId} - will be replaced by the content of the labelTextResourceId validator attribute in final message, only if that attribute exists

Validator signatures

Check required value

[name:RequiredValidator],[message=validatorMessage]]

Example

@string/screen13_falseCeiling1stFixRequiredValidatorMessage - validator message
[name:RequiredValidator],[message=@string/screen13_falseCeiling1stFixRequiredValidatorMessage]

Can be used on widgets