I have seen various blogs and discussions on this topic, but I haven't been able to find a proper solution for this. My problem sounds pretty simple. I have some fields that are required, and I have two buttons, a "Save" and a "Submit". I am using backing beans (not ADFBC) as my model layer. I have action listeners on the Save and Submit buttons to persist and then "submit" the data. For the Submit button, immedate=false, which is what I want, to force all required fields to be entered. But when they press "Save", I want to save all the data, regardless of whether they have entered required fields so far. I can't use immediate on button, because the model doesn't get updated, and my values don't get saved. I tried setting immediate on the button, and on the form elements, along with a value change listener on the form elements, but that also doesn't work, because it will try to process the validations still when both are set to immediate (see this blog post for more that: ADF Practice: Understanding the JSF Immediate Attribute )
I've tried a dizzying amount of approaches, and I've been able to either skip validation, or update the model, but I can't seem to get both to happen at the same time.
I have seen this link, which got me close to a solution:
ADF Practice: How to avoid validation of immediate inputs
I've also tried using an action listener on the button to set a flag that the required field looks at. In this case I used javascript as described in the blog post above to avoid client side checking. But then serverside I still have the problem that the action listener doesn't fire until after the validations are complete, so that is no use to me either.
Is anyone aware of any global "processUpdates" function I can use that will apply model updates to everything? Only examples I've seen are tied to individual components using valueChangeEvents. But I think those don't fire when the button is set to immediate=true and the form item is immediate=false. Making them both immediate="true" cause the validation to still execute.
Is there a way to override the processing of the validation phase itself? I've looked a little at phaseListeners, but those appear to hook in before and after each lifecycle step. Is there something I can set in the beforePhase to cause it to skip that phase and move to the next phase? I need something to skip over the validation step and proceed onto model update for everything.
Thanks in advance for your ideas!