Skip to content
This repository was archived by the owner on Nov 16, 2020. It is now read-only.

Add containsKey tag#58

Open
jdanthinne wants to merge 1 commit intovapor:masterfrom
jdanthinne:master
Open

Add containsKey tag#58
jdanthinne wants to merge 1 commit intovapor:masterfrom
jdanthinne:master

Conversation

@jdanthinne
Copy link
Copy Markdown

When building forms (this is an example of the use of this tag, there can be many other), I usually tend to build a dictionary of validation errors as ["name_of_the_field": "This is the validation error to show"].
With this tag, when looping over my fields, I could just test if the dictionary contains a validation error for a given field with #if(containsKey(validationErrors, "name_of_the_field")) and then display the error if needed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant