In adf, I have a table in which the autosubmit is set to true for a column. When we change this value it is going through its life cycle and the value is getting update but the entity validations for that row is getting skipped when toggling to the other rows, but when we try to commit it to the DB it is getting validated since the transaction became dirty. Is there any feature which helps it to do the entity validation or anything wrong with my concept.
P.S: It is working fine when autosubmit = "false" i.e entity validation is trigger while toggling between the rows before committing it to the DB.
I believe that usually autoSubmit validation would fire on a navigationevent. It is hard to know exactly what is wrong without seeing your code, but some things that might resolve your problem include:
Ensure the validation is for the attribute being submitted and not for the whole row
Ensure you have not set skipValidation="true" or altered the phase in another way (ie pageDef)
Ensure if you have overridden the default rowNavigationListener that is still triggering validation.
Ensure there is no ppr removing your the error message from the validation on row navigation and making it appear as if validation that actually did occur, did not.
Try adding BlockRowNavigationOnError="always" to your table and see if it still lets you change rows.
Related
I don't want Formik to run the validaiton schema of a field if it's equal to its initial value at any point. I have looked everywhere on the web to achieve this but unfortunately could not find a solution.
The docs are very convoluted in regards to this simple functionality. There is a prop called isInitialValid but it's deprecated and no longer works. It says to use initialErrors as an alternative but there is no explanation on how to use it, especially in the same way I need.
Screenshot: formik_docs
( https://formik.org/docs/api/formik )
If there is no way of achieving this in Formik then I thought perhaps to achieve it inside of the Yup validation schema itself, and so I would want to tell Yup to "run this entire validation only if a certain condition is met" (if the given value is not equal to initial value). So that is one of the potential solutions I tried implementing but I don't know how to do that with Yup. Of course it would be better if Formik has a solution, so this is plan B.
I have made simplified boilerplate code and will appreciate if answers use it. It's MUI/Formik and has the email field with an initialValue which should skip validation https://codesandbox.io/s/formik-sandbox-3bci5l?file=/src/App.js
For context: I am making a form that edits an item, so the initial values would all be filled with that item's properties, and it's possible that the dev team decides to add new validators for each property but we decided we don't want to force changes to previous values based on newly added validations. Even better would be to somehow make them into warning messages (so MUI would simply color the errors yellow) and still allow submit, but I'll put that aside for now since that would be much more complicated to achieve.
Thank you in advance for any help.
I have a database (table) on Microsoft Access that's constantly updating from python and I have a form displaying Fields from that table. How do I make a form update (refresh) automatically when data is added to the table it's reading from?
I've set a button that runs Me.Requery when pressed thus refreshing the Form and getting the new data, but I want for to update/refresh automatically. On Data change (Form_datachange) doesn't work (don't know why).
I don’t think you can run a macro to requery your form when the table updates due to the restrictions on data macros.
However, you can put your requery logic in the form’s OnTimer event and set it to run at a desired interval (e.g. 5000 ms which is 5 seconds)
We have an edit form that only allows one user to edit a form at a time. The form is quite large and has quite a bit of Knockout.js code in it and this code intercepts the Submit button click to do validation, then if everything is fine it submits the form.
Nothing has changed on the server side or view side, yet just in the last few days we are having a large amount of OptimisticConcurrency errors being logged.
Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. See http://go.microsoft.com/fwlink/?LinkId=472540 for information on understanding and handling optimistic concurrency exceptions.
The only other correlation is that some users are complaining about the site running slow. I was hoping someone may have a guess as to what is causing this? It is probably affecting less than 1% of our forms but this still causes a lot of inconvenience. It is a MVC 5 site on a load balanced server.
Aside from what may be causing this, is there some other idea of what I should do to solve the problem, like switching to a client wins concurrency exception? These are medical records so any data loss could be detrimental.
Update
From the comments, here is the code that runs when the submit button is pressed.
self.saveClick = function () {
validationTests();
if (self.validationError()) {
return false;
} else {
return true;
}
}
So that wouldn't disable the button from being pressed multiple times, would it? This may be the problem, now that the site is running slow.
As you're getting multiple submits from the same user it's probably worth ensuring that your submit button is disabled on a click.
Here's a question with an example of how to do this
Disable submit button on form submit
worth noting that as you're doing lots of validation then you need to re-enable the button if it fails validation.
I've a store that is using a memory proxy. The store get it's data by calling the loadRawData method. I now make some changes to this data using roweditor & rowaction which result in dirty records which seems to be a correct behavior but this store will never be able to sync any data so why are all cells marked with this red triangle?
I think I must oversee something here. How can I spare these trinangels without loosing the track on modified fields?
I am using ExtJS 4.2.1
If you don't want the little red triangles on your grid, you can set the following in the viewConfig.
markDirty: false
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.view.Table-cfg-markDirty
As LUKE already answered the Question I will add just some additional information about the dirty flag of a record
Note: the dirty flag is marked as readonly and this is for a reason.
Here is at least one reason:
The time set() finishes the record has already published the
changes to the store(s) which in the same time fires the update event for
the modified data.
So changing the dirty flag will have no affect because it happens after all this! So the record will be already marked as dirty e.g. the grid will have already marked all changed columns with the red triangle.
To prevent the record from setting it's dirty flag use a beginEdit() / endEdit() block and don't use set because set() will always set dirty the flag.
Here is a example which inverts a boolean and don't affect the dirty flag
record.beginEdit();
record.data.active = !rec.data.active;
record.endEdit();
When baking models in CakePHP, should I add validation criteria only to the data which are user input? Or to everything? Or to some specific data? The database consists mostly of things which will be added by admins. There's only 1 user-related table. I'm not sure about this. Thanks.
Validate everything!:
Validation to everything. There's no reason not to add validation to everything. If an admin knows what they're doing, and is inserting data per the requirements, they won't see any of the validation errors anyway. But - if they have a moment of insanity, or just don't know what's allowed/not, then having the validation is a great fallback.
We've all done it (or... NOT done it):
It's understandable for a small/simple project to not want to spend the time adding validation - we've probably all done it... but when asked "SHOULD you add validation to everything?", I think the answer has to be "yes!".
Validation - not just for user-generated content:
Validation is overall great - not just for user-entered data, but also for scraped, code-generated data, admin-entered data, and everything in between.
Can be slightly lax... if you must
If most of your data isn't user-generated, you could always think about making the validation slightly more lax than it would be otherwise, but - having it is still better than not.