The Scribcopia blog article
is a good reference to start with workflow customization in touch UI. In this article, I am going to describe few additional steps which help you to perfect the authoring behavior.
Below is the sample code to refer on what events you need to handle in your client library code. You need to change it as per your business requirements.
Here two fields are added one of which reviewer is mandatory and the other is scheduled publish time.
1. Handling Validation of additional fields in start workflow dialog
You need to add in custom java-script clientlibs file with category- "cq.authoring.editor.core,cq.authoring.editor" (Obviously, the two categories will be added separately in your categories multifield property of your clientlibs.)Below is the sample code to refer on what events you need to handle in your client library code. You need to change it as per your business requirements.
Below things are done in this code:
- If author selects your custom workflow model- Show additional fields and disable the submit button in order to stop submitting the form without filling the mandatory field(s).
- The second part of code handles enabling/ disabling of the workflow start button based on author filling out the mandatory field(s).
2. Adding additional fields in start workflow dialog
Please note that the custom class selectors for the additional fields are added in startworkflow.jsp file as mentioned in the Scribcopia blog post. Below is the sample code for the same:Here two fields are added one of which reviewer is mandatory and the other is scheduled publish time.
No comments:
Post a Comment