05-22-2019 12:30 AM
Hi everyone,
How can I add reset button in workflow form which will clear all the fields on the form except one?
Thanks,
Yash
05-23-2019 02:38 AM
One way will be to extend form.get.html.ftl,this file is responsible for rendering all form in alfresco share.Form related to content as well are rendered using this file.So any change you make in this file will reflect in all forms.You can add condition like if it is workflow form then and then only you need to make reset button visible.
This template is importing one more template named as form.lib.ftl which is responsible for rendering the form buttons.Below is the same macro where you need to add button.
<#macro renderFormButtons formId>
<div id="${formId}-buttons" class="form-buttons">
<#if form.showSubmitButton?? && form.showSubmitButton>
<input id="${formId}-submit" type="submit" value="${msg("form.button.submit.label")}" />
</#if>
<#if form.showResetButton?? && form.showResetButton>
<input id="${formId}-reset" type="reset" value="${msg("form.button.reset.label")}" />
</#if>
<#if form.showCancelButton?? && form.showCancelButton>
<input id="${formId}-cancel" type="button" value="${msg("form.button.cancel.label")}" />
</#if>
</div>
</#macro>
Explore our Alfresco products with the links below. Use labels to filter content by product module.