AnsweredAssumed Answered

How search with a form with more than one checkboxes?

Question asked by gabriel.batista on May 24, 2018
Latest reply on May 28, 2018 by gabriel.batista

I have an advanced search form with three checkboxes properties, when I check just one of this property the results are of documents that has only the checked property. Is possibly to make a form that can search for all documents with one checked property, but not excluding the documents with others unchecked properties?

 

Below a snippet of my code:

Custom model

 

<types>
    <type name="demo:demoPastaRH">
        <title>Tipo Pasta RH</title>
        <parent>cm:folder</parent>
        <mandatory-aspects>
            <aspect>demo:dadosFuncionario</aspect>
            <aspect>demo:validacaoConteudoPastaRH</aspect>
        </mandatory-aspects>
    </type>
</types>




<aspects>
    <aspect name="demo:dadosFuncionario">
        <properties>
            <property name="demo:cpfFuncionario">
                <type>d:text</type>
                <mandatory enforced="false">true</mandatory>
                <index enabled="true">
                    <atomic>true</atomic>
                    <stored>false</stored>
                    <tokenised>false</tokenised>
                </index>
            </property>
        </properties>
    </aspect>
   
    <aspect name="demo:validacaoConteudoPastaRH">
        <properties>
            <property name="demo:contemFRE">
                <type>d:boolean</type>
                <index enabled="true">
                    <atomic>true</atomic>
                    <stored>false</stored>
                    <tokenised>both</tokenised>
                </index>
            </property>
            <property name="demo:contemContratoTrabalho">
                <type>d:boolean</type>
                <index enabled="true">
                    <atomic>true</atomic>
                    <stored>false</stored>
                    <tokenised>both</tokenised>
                </index>
            </property>               
            <property name="demo:contemAsoAdmissional">
                <type>d:boolean</type>
                <index enabled="true">
                    <atomic>true</atomic>
                    <stored>false</stored>
                    <tokenised>both</tokenised>
                </index>
            </property>               
        </properties>
    </aspect>       
</aspects>

 

 

Search Form

 

<config evaluator="model-type" condition="demo:demoPastaRH">
    <forms>
        <!-- Search form -->
        <form id="search">
            <field-visibility>
                <show id="cm:name" />
                <show id="cm:description" />
                <show id="demo:cpfFuncionario" force="true" />
                <show id="demo:contemFRE" force="true" />
                <show id="demo:contemContratoTrabalho" force="true" />
                <show id="demo:contemAsoAdmissional" force="true" />
            </field-visibility>
            <appearance>
                <field id="demo:cpfFuncionario">
                    <control template="/org/alfresco/components/form/controls/textfield.ftl" />
                </field>
                <field id="demo:contemFRE">
                    <control template="/org/alfresco/components/form/controls/checkbox.ftl" >
                        <control-param name="mode">OR</control-param>
                    </control>
                </field>              
                <field id="demo:contemContratoTrabalho">
                    <control template="/org/alfresco/components/form/controls/checkbox.ftl" >
                        <control-param name="mode">OR</control-param>
                    </control>
                </field>
                <field id="demo:contemAsoAdmissional">
                    <control template="/org/alfresco/components/form/controls/checkbox.ftl" >
                        <control-param name="mode">OR</control-param>
                    </control>
                </field>
            </appearance>               
        </form>
    </forms>
</config>

Outcomes