Usecases like this inspired Mike and me to create the OtionalValidator-stuff (<http://wiki.apache.org/myfaces/OptionalValidationFramework>) BUT it only works well when you are using facelets... (the pure 1.1 lifecycle is a major PITA for this kind of processing...)
In your case the "add" and "delete" buttons would carry the "soft" flag to the validation... and the "register" and "save" buttons the "hard" flag... hth Alexander PS: The usability of this component or its alternatives are also on my todo-list... PS2: Usually I try to be on the IRC-channels sometimes a week... (nick: AJesse) > -----Original Message----- > From: Andrew Robinson [mailto:[EMAIL PROTECTED] > Sent: Monday, June 12, 2006 1:41 AM > To: MyFaces Discussion > Subject: Help: "Ignore" validation and still update model? > > Okay, I am having an issue for a non-standard configuration (go > figure, I think I am in the "20%" just about 80% of the time) and am > looking for help. > > I think what I have to do is continue to the update model phase even > when validation fails, but I'll tell you what I am doing in case > anyone has a better idea. > > I have a register user form. It has three child tables (t:dataTable) > one for each of: email addresses, phone numbers and geographic > addresses. I have done it this way so that the user can enter multiple > emails, phone numbers and addresses (for example, a work phone, a cell > phone, etc). These tables are backed by Hibernate configured lists (so > I have a FK child tables to store these records for the user table). > > In my view, I have "Add" and "Delete" buttons for the tables (and rows > in the table). I don't care when the user clicks and add or a delete > if components are invalid within the page (I only care when they click > the "Register" for new users or "Save" for existing users). > > I tried marking the command links as immediate, but as those familiar > with JSF would know, opened a can of worms. Since data tables do not > support submitted values in child components, the user's data from the > data tables disappeared when the view was re-rendered. So a no-go > there. > > So I really need the update model phase to complete. (Yes one solution > would be to enable AJAX for this project and only refresh the table > row for the add or the delete, but that is beyond my scope for this > project). > > Is there a way to let validation happen, but regardless of validation > errors and warnings, to go ahead and update the model and execute the > action? > > I suppose I could use a sub-form from the sandbox, but would that not > cause the input fields in the other tables to loose their values > anyways since validate and updating of the model does not take place > for non-subform fields (I haven't tried the sub form out yet although > it sounds like a good idea)? > > Another option may be to use a custom component that would update the > value during the validation phase, but not stop the life cycle (so > that the validation still occurs, and the values would still be kept > for data table rows). I think that will work (didn't think it through > fully yet), but it is messy (Basically a commandLink that doesn't use > ActionEvent, but a custom event that does it's work during broadcast > of process validators or apply request values). > > Anyone have a bright idea to get around this solution? > > Thank you > -Andrew > > PS - also is there any way without partial page refreshing that > inputSecret fields can not loose their value when the view is > re-rendered (maybe by sending a static "fake" value down to the client > that says to use the last value and then store that "last value" in > the user's session?)? >

