I have a basic workflow with two steps for Reviewer to reject or approve the workflow. These steps are shown as the dropdown options on the Complete workitem screen of the notifications page.
Currently the comments field on the Complete workitem page is optional. I need to make it mandatory for only rejection case, i.e. whenever reviewer selects Reject option from dropdown, comments should be mandatory field.
I tried adding "required=true" property in the "/libs/cq/workflow/content/notifications/completeworkitem/items/content/items/itemdetails/items/well/items/comment" node by overlaying. But that makes it mandatory for all the cases.
Can someone help me on it. Can I use listeners? If yes then where, as here there is no specific dialog?
For this use case - you are correct - once you set /libs/cq/workflow/content/notifications/completeworkitem/items/content/items/itemdetails/items/well/items/comment to true - the comment field will be mandatory.
I do not think you can use event listeners for this use case.
As its a TOuch UI dialog - the only thing i can think of is looking at the possibility of using the Show/Hide feature. See