xmlalfrescoalfresco-sharealfresco-webscripts

How to hide/show sets in [alfresco] form control


I want to how i can hide this 'set' if its field is empty and show this set if its field has any value.

<config evaluator="task-type" condition="vorwf:allocateDocumentProperties" replace="true">
    <forms>
        <form id="workflow-details">
            <field-visibility>
                <show id="bpm:workflowDescription"/>
                <show id="packageItems" />
                <show id="bpm:comment" />
                <show id="transitions" />
            </field-visibility>
            <appearance>
                <set id="information" appearance="title" label="Workflow Information" />
                <set id="wfinfo" appearance="" template="/org/alfresco/components/form/2-column-set.ftl" />
                <set id="assignees" appearance="title" label="Assignees" template="/org/alfresco/components/form/3-column-set.ftl" />
                <set id="items" appearance="title" label="Workflow Documents" />
                <field id="bpm:workflowDueDate" label="Due Date" set="wfinfo" read-only="true">
                    <control template="/org/alfresco/components/form/controls/date.ftl">
                        <control-param name="showTime">false</control-param>
                        <control-param name="submitTime">false</control-param>
                    </control>
                </field>
                <field id="bpm:workflowPriority" label="Priority" set="wfinfo" read-only="true">
                    <control template="controls/workflow/priority.ftl" />
                </field>
                <field id="transitions" set="outcome" />
            </appearance>
        </form>
    </forms>
</config>

If anyone has any ideas please let me know!


Solution

  • You can take help of view-form/edit-form and use a custom template. https://docs.alfresco.com/5.2/references/forms-reference.html

    Example of a custom edit-form template is given here: https://docs.alfresco.com/5.2/tasks/forms-custom-formtemplate.html