Custom attribute running once only
See original GitHub issuemy select radio only runs the Custom attribute once, while the others run every time I submit.
The first on is the radio, the second one is just a input. The latter, custom, runs every time I hit submit and displays an validation error fine. The former, radio, runs only once, the first time – before I save off to the DB, and displays a validation error.
If I save, by not checking otherNamesUsed (which by passes the validation), and come back in and check this otherNamesUsed, only the input custom runs and validates. The radio custom never runs again.
nameChanged: {
type: String,
optional: true,
allowedValues: ["No", "Yes"],
custom: function () {
if (this.field('otherNamesUsed').value === "Yes" && (this.value === undefined)) {
return "required";
}
}
},
otherName1First: {
type: String,
optional: true,
custom: function () {
if (this.field('otherNamesUsed').value === "Yes"
&& (this.value === null || this.value === "" || this.value === undefined)
) {
return "required";
}
}
}
Other names used
otherNamesUsed: {
type: String,
optional: false,
allowedValues: ["No", "Yes"]
}
Radio control and input control
{{> afFieldInput name=nameChanged type="select-radio-inline" options="allowed" template="bootstrap3-horizontal"}}
{{> afFieldInput name=otherName1First placeholder=placeHolder template="bootstrap3-horizontal"}}
Issue Analytics
- State:
- Created 9 years ago
- Comments:10
Top Results From Across the Web
Mystery: my custom C# attribute is used once, but constructed ...
I have this very simple unit test which uses a very simple custom Attribute. The attribute is added only to 1 class which...
Read more >Writing Custom Attributes | Microsoft Learn
The primary steps to properly design custom attribute classes are as follows: Applying the AttributeUsageAttribute.
Read more >Defining and Using Custom Attribute Classes in C#
Because you can create your own custom attribute classes and then act upon them, ... But Binaries (assemblies) aren't just for run-time.
Read more >Add Custom Attributes to Active Directory Users
In this lecture you will learn how you can add custom attributes to your Active Directory user accounts. We are going to add...
Read more >Creating Custom Attributes - powershell.one
A PowerShell attribute is a class that derives from the type [System. Attribute], so it takes only a few lines of code to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sptessier I realize your last comment was a long time ago, but I just wanted to mention that I gave up on the
convertModifierToDoc
approach because there are a lot of edge cases where I couldn’t figure out a good solution. If anyone can figure it out, I agree it would be a pretty slick way to support modifiers without people who use the package needing to be aware of the modifier itself. One idea might be to skip validation for tricky modifiers like$inc
or$rename
and you’d have to opt-in to use them otherwise it would just throw an error when you try to use them.The Meteor SimpleSchema package is no longer maintained other than critical fixes to keep it running with each latest Meteor release. Closing non-critical issues in this repo. Anyone who cares about this may do one or more of the following: