首页 > 解决方案 > 如何在 [alfresco] 表单控件中隐藏/显示集合

问题描述

我想如果它的字段为空,我如何隐藏这个“集合”,如果它的字段有任何值,则显示这个集合。

<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>

如果有人有任何想法,请告诉我!

标签: xmlalfrescoalfresco-sharealfresco-webscripts

解决方案


您可以借助 view-form/edit-form 并使用自定义模板。 https://docs.alfresco.com/5.2/references/forms-reference.html

此处给出了自定义编辑表单模板的示例: https ://docs.alfresco.com/5.2/tasks/forms-custom-formtemplate.html


推荐阅读