New or Edit state check on validation from controller
The objects that I use as form-backing objects in my controllers don't get Id's until they are saved to the database. However, I'm having trouble validating from my controllers whether a null Id is an error or it's just an unsaved object. I don't really want to put an isNew method on my form-backing objects. Has anyone else overcome such an issue? Am I missing something?
Thanks in advance.
Re: New or Edit state check on validation from controller
My id's are usually not exposed to the user, but rather as a hidden field in a form. When the record is new, the id of my POJO (a Long) is set to null - when it's an existing record, it's not. I doubt your issue is that simple, but it's worth a shot.