cancel
Showing results for 
Search instead for 
Did you mean: 

Sets in advanced search forms

jordiv
Champ on-the-rise
Champ on-the-rise
Hi,

I've created some new advanced search forms for my custom types as described in the Working with Custom Content Types tutorial by Jeff.

I want to group the metadata in the view, and I've tried using form set, but it doesn't seem to work for the search form. For the edit metadata form is working fine.

Any clue of how to achieve this?

The relevant code of my share-config-custom.xml:

    <config evaluator="string-compare" condition="AdvancedSearch">
        <advanced-search>
            <forms>
                <form labelId="label.my_workContract" descriptionId="label.my_workContract_description">my:workContract</form>
            </forms>
        </advanced-search>
    </config>
    <config evaluator="node-type" condition="my:workContract">
        <property-sheet>
            <show-property name="my:workContractType" display-label-id="label.my_workContractType" />
            <show-property name="my:workContractWorkerId" display-label-id="label.my_workContractWorkerId" />
            <show-property name="my:workContractWorkerName" display-label-id="label.my_workContractWorkerName" />
        </property-sheet>
        <forms>
            <form>
                <field-visiblity>
                    <show id="my:workContractType" label-id="label.my_workContractType" />
                    <show id="my:workContractWorkerId" label-id="label.my_workContractType" />
                    <show id="my:workContractWorkerName" label-id="label.my_workContractType" />
                </field-visiblity>
                <appearance>
                    <set id="workContractSet" appearance="fieldset" label="Work Contract Properties" />
                    <set id="" appearance="fieldset" label="General Properties" />

                    <field id="my:workContractType" set="workContractSet" />
                    <field id="my:workContractWorkerId" set="workContractSet" />
                    <field id="my:workContractWorkerName" set="workContractSet" />
                </appearance>
            </form>
            <form id="search">
                <field-visiblity>
                    <show id="my:workContractType" label-id="label.my_workContractType" />
                    <show id="my:workContractWorkerId" label-id="label.my_workContractType" />
                    <show id="my:workContractWorkerName" label-id="label.my_workContractType" />
                </field-visiblity>
                <appearance>
                    <set id="workContractSet" appearance="fieldset" label="Work Contract Properties" />
                    <set id="" appearance="fieldset" label="General Properties" />

                    <field id="my:workContractType" set="workContractSet" />
                    <field id="my:workContractWorkerId" set="workContractSet" />
                    <field id="my:workContractWorkerName" set="workContractSet" />
                </appearance>
            </form>
        </forms>
    </config>


Thanks,
Jordi
2 REPLIES 2

erikwinlof
Confirmed Champ
Confirmed Champ
Hi Jordiv,

You have misspelled <field-visiblity>, it should be <field-visibility>. Not sure if it helps since its misspelled for both forms and it sounded like one of them worked.

Please tell us the result so we can look for another error or marked it as solved if it helped.

Cheers,

:: Erik

jordiv
Champ on-the-rise
Champ on-the-rise
Thanks Eric.

Now it works for me, here is the peace of xml from share-config-custom.xml file:

    <config replace="true" evaluator="string-compare" condition="AdvancedSearch">
        <advanced-search>
            <forms>
                <form labelId="search.form.label.cm_content" descriptionId="search.form.desc.cm_content">cm:content</form>
                <form labelId="search.form.label.cm_folder" descriptionId="search.form.desc.cm_folder">cm:folder</form>
                <form labelId="label.my_bill" descriptionId="label.my_bill_description">my:bill</form>
                <form labelId="label.my_workContract" descriptionId="label.my_workContract_description">my:workContract</form>
            </forms>
        </advanced-search>
    </config>
<config evaluator="node-type" condition="my:workContract">
        <forms>
            <form>
                <field-visiblity>
                    <show id="my:workContractType" label-id="label.my_workContractType" />
                    <show id="my:workContractWorkerId" label-id="label.my_workContractType" />
                    <show id="my:workContractWorkerName" label-id="label.my_workContractType" />
                    <show id="my:workContractRelated" label-id="label.my_workContractRelated" />
                </field-visiblity>
                <appearance>
                    <set id="workContractSet" appearance="fieldset" label="Work Contract Properties" />
                    <set id="" appearance="fieldset" label="General Properties" />
                    <field id="my:workContractType" set="workContractSet" />
                    <field id="my:workContractWorkerId" set="workContractSet" />
                    <field id="my:workContractWorkerName" set="workContractSet" />
                    <field id="my:workContractRelated" set="workContractSet">
                        <control template="/org/alfresco/components/form/controls/association.ftl">
                            <control-param name="showTargetLink">true</control-param>
                            <control-param name="startLocation">{doclib}</control-param>
                        </control>
                    </field>
                </appearance>
            </form>
        </forms>
    </config>
    <config evaluator="model-type" condition="my:workContract">
        <forms>
            <form id="search">
                <field-visiblity>
                    <show id="my:workContractType" label-id="label.my_workContractType" />
                    <show id="my:workContractWorkerId" label-id="label.my_workContractType" />
                    <show id="my:workContractWorkerName" label-id="label.my_workContractType" />
                </field-visiblity>
                <appearance>
                    <set id="workContractSet2" appearance="fieldset" label="Propiedades del Contrato de Trabajo" />
                    <set id="" appearance="fieldset" label="Propiedades Generales" />
                    <field id="my:workContractType" set="workContractSet2">
                        <control template="/org/alfresco/components/form/controls/selectone.ftl" />
                    </field>
                    <field id="my:workContractWorkerId" set="workContractSet2">
                        <control template="/org/alfresco/components/form/controls/textfield.ftl" />
                    </field>
                    <field id="my:workContractWorkerName" set="workContractSet2">
                        <control template="/org/alfresco/components/form/controls/textfield.ftl" />
                    </field>
                </appearance>
            </form>
        </forms>
    </config>


Cheers,
Jordi