cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow : How to make a field required only for the accept button and not the reject one?

ganie_
Champ on-the-rise
Champ on-the-rise

Hi,

On Nuxeo 5.6, using Studio, about forms in accept/reject tasks : I would like through the workflow designer to make a field required, but only for the "accept" button and not for the "reject" one.

I tried something by setting the required field to false and by using conditions on transitions in a way that I "manually" check the value of a given NodeVariable, if it is empty and the user pressed "validate", the user is redirected to the same task. But this lead to a user-confusing experience I'm trying to avoid.

The nice way would be to work at the jsf form validation level so the user is not redirected to an other page. Is it possible through studio? Is it even possible outside studio?

Thanks

1 ACCEPTED ANSWER
13 REPLIES 13

Ok, thx. I guess I ll stay with my condition trick for a while

Hi,

ok, I thought he wanted the same behavior when a person develops a classical form with the accept and cancel buttons, where the person pressing the cancel button does not matter any validation

Well, I understand the difference, however, the case suggested by murkein might be enough for me. In my specific case, I don't care about the field value when I reject the form.

Anahide_Tchertc
Elite Collaborator
Elite Collaborator

You can try adding the following expression for the custom property "required" on the widget definition:

#{request.getParameter('button') == 'accept'}

Here 'accept' is the name of the button defined on the workflow.

thanks, it works

Ok, I will try this one, I thought the "required" custom property was only evaluated when the form is rendered so it's value is precalculated before the form submition. I'll see

well it is evaluated once, so that the form can display a "*" marker to show the user that the field is required, but it's evaluated again at submit