How to perform cell validation in #ag-grid for Angular 4 - ag-grid-ng2

I have started using ag-grid in my Angular 4 project, and was unable to find any API's for performing in-line cell validations i.e. whenever user edits a particular cell, the requirement is to perform a required field and pattern validation. In case of any validation errors, the corresponding editable field should get highlighted and an error message needs to be displayed.
I have used the following cell events to fulfill the above purpose, but none of them provided me the desired result.
cellEditingStarted
cellEditingStopped

Related

Google Sheets - Run script based on value

I'm very new to scripting and really need some help getting started.
Basically I'm trying to develop a simple script to show a warning message when a certain value in a cell has been selected from a drop down list.
When the option 'Behind' has been selected I just want a simple popup window or something to say 'Review is needed'.
I've explored 'toast' but I'm not sure how I'd get the script to run based on the value.
Any help would be much appreciated, I'm going bald :(
Emma
You can also achieve this kind of behavior without writing your own script. See Data validation.
Select the cells for which you want this to apply
Click on Data -> Data Validation in the menu
Set your criteria for allowed values
On invalid data, select either Show Warning or Reject Input (the latter will reject the input and show a toast)
Put a checkbox in Show validation help text to add a custom warning text

iOS: Accessibility support for dynamic labels / validation errors?

I want to enable accessibility support in my app where i have In-line validation message (e.g As per below screenshot) when user enters something invalid data. My app doesn't show any error message.
What can be best and intuitive way to inform visual impaired/blind user about wrong data entries. e.g. Username & password mismatch, invalid.
First off, there is no "correct" way to do this. There are just a bunch of ways that work. The "best" way to do this, would be for iOS to have a "required" trait (IMO). But this is not supported, so we have to work with what iOS has given us... hints and labels.
Step 1:
Tell the user what is required. I would do this by adding the information to the hint. I like to add information to the hint that only non-familiar users need. "Power users" of your application will get use to what fields are required (assuming you're going to have return users, some views are just "hit and run" types). But, point being, don't flood users with unnecessary information. Users who visit a particular view frequently will get use to what is required, so keep non-crucial information in the hint. What you want is voiceover to read out the text input fields like this: "Email(accessibilityLabel) text field (the type of object), (pause) This field is required.(hint)" Don't wait until after a failure to provide this information to VoiceOver users. It should just always be set this way. If the type of failure changes, change the hint to adapt to this particular type of failure. If you'd like to keep the hint in sync with the Red highlighted labels, you can consider overriding the functions from the UIAccessibilityProtocol to pull out this information EX:
- (NSString*)accessibilityHint {
return myUILabel.text;
}
This should cause to keep the hint of the object, and the text of your UILabel in sync.
Step 2:
Mark all elements that are not the text input fields, as not accessibility elements. All of the information a user needs about those fields is either stored in the type of the field (a text input field), the label (email/password), or the hint (whether or not it is required). Therefore, we don't want VoiceOver to look at the other elements, because this would be duplicate information.
Step 3:
Use the following line of code:
UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, anAccessibilityElement);
In your login action. On a failed login action, you should shift voiceover focus to the element that caused the failure. This informs the user that their action was attempted, and that it failed. It also allows them to easily know which element caused the failure, and that it needs fixed. In the event of multiple failures, make sure you shift focus to the first failure!

Is there any way to keep validate field optional in rails?

I have User model which includes 7 fields. for all these fields validation is written.i have two form where i am displaying fields depend on condition. in one form i have name password and city and other form i have role,phone and name.
When i try to submit the first form i got the error which says phone and role field are required resulting into failure of form.
Is there any way by which i can submit both form without getting the validation errors ??
Note : i want my logic to be in model only.. Please help me with this problem.
You could use a conditional validation to achieve what you want:
See here: http://guides.rubyonrails.org/active_record_validations.html#conditional-validation
However, this can quickly get hard to manage. Depending on the condition you're switching on, it'd probably be a cleaner design to use a 'Form Object' which will give you more control and let you do validations without the messy conditional logic.
See section #3 of this blog post for more detail:
http://blog.codeclimate.com/blog/2012/10/17/7-ways-to-decompose-fat-activerecord-models/
Using this pattern, you would check for your condition in the controller then determine which form object to send to the view.

List all the invalid controls in Orbeon forms

I have 30 fields in my form. At the bottom of the form I have a button where if I click on it, it should display all the fields which are invalid. Invalid includes not filling the mandatory fields also.
Using xforms:trigger I can create a button and using DOMActivate even I can write xforms:action. But what should I write inside the xforms:action to list all invalid fields.
You can implement your own error summary by listening to events like xforms-valid and xforms-invalid, keeping track of which controls are valid and invalid. But this is not a trivial task, especially if you want to handle repeats, and even nested repeats. Fortunately, this work has been done already for you, and the code has been put in a reusable component: <fr:error-summary>.
If you are using Form Runner, the error summary is setup for you by default. Otherwise, see this documentation on how to use the error summary component.

How do i filter and validate form fields in symfony 1.4?

Im trying to integrate a content filtering API. My plan was to use pre/post validators but I've lost may way somehow.
What i need to do is send the values to the content filtering service. If the response comes back that the content has been filtered it will also return a modified value for the field (basic profanity filtering... matches are replace with asterisks). Thats all well and good i can throw validation errors no problem - simple stuff.
However i dont want just throw errors. What needs to happen is that validation errors are thrown as normal, but the values are modified in the form for re-display.
Basically if someone posts something naughty i want them to get a validation error saying their post has been modified, they can re-submit the now "clean" post, or they can go about editing it to make it clean without the word replacements.
But do clean on a validator either throws an error OR returns cleaned values, not both. How can i go about implementing both? This will be used on many different forms with many different field names, so modifying methods on the form or a form base class isnt really an option - it needs to happen in the validation sub-framework somehow.
You can adjust this plugin for your needs http://www.symfony-project.org/plugins/WebPurifyPlugin

Resources