Hello,
A rather exotic question. :-)
EDIT: using JDEV 11.1.1.4
Suppose you have a form that consists of inputTexts and some of them are required (required = true). These come from a data control that is based on a BPM Human Task.
What my customer wants is two buttons: one submit button, and one save button.
The submit button behaves normally: when a required field is not entered, a validation error is shown.
The save button on the other hand, will perform a model update without complaining, even though some required fields could be empty. This would be the Save operation on the BPM Data Control: the values that the user entered are saved (in the BPM engine), but the process does not continue. It's like saving a draft version of the fields you entered, so you can continue filling in the form for example the next day.
How can I achieve this? Where I have gotten so far:
*) If I do not make the "Save" button "immediate", then the client side validation will keep on complaining about the empty required fields.
*) If I make the "Save" button "immediate", then the client side validation is skipped. But the Update Model Values phase is also not executed, so values that the user entered are not stored in BPM. Too bad.
My plan now is making the button immediate, and then overriding page life cycle in case the Save button is pressed. I already created my own implementation of oracle.adf.controller.v2.lifecycle.PagePhaseListener. In the afterPhase() method, I then wanted to check if the current phase is the "Apply request Values" phase (if the button is immediate, then this is the last phase before the "Render Response" phase), and if so, manually call the updateModelValues phase, like this:
public void afterPhase(PagePhaseEvent pagePhaseEvent) {
int id = pagePhaseEvent.getPhaseId();
if(pagePhaseEvent.getPhaseId() == 10 && <user has clicked the SAVE button, not the Submit button>){ // APPLY REQ VALUES
LifecycleContext ctx = pagePhaseEvent.getLifecycleContext().getCurrentInstance();
ctx.getPageController().processUpdateModel(ctx);
}
}
The <user has clicked the SAVE button, not the Submit button> condition will be done through a variable on session scope that is set to true/false depending on the button (save or submit) that was pressed, by using a setActionListener on that button.
Unfortunately, the model is still not updated and I'm kind of stuck... Can anyone help me?
Am I barking up the wrong tree and can this be done a lot easier, or what am I missing?
Thanks a lot!
Edited by: user13805808 on Jan 31, 2011 6:29 AM