cancel
Showing results for 
Search instead for 
Did you mean: 

Mandatory selection for 'selectone.ftl' field in a Form

d_franz
Champ on-the-rise
Champ on-the-rise
I have generated a Forms for sepecific data types of my new data model. I am using some selectOne fields to fill up the metadata.

How can I make a selection of the select one mandatory? In the moment even when I set the field to mandatory (in content model definition) I can save without a selection.

In the moment I defined the selectone in"share-config-custome.xml" as follows:

<field id="nci:sensor_recordMode" set="SensorInfoGlobal">
   <control template="/org/alfresco/components/form/controls/selectone.ftl">
   <control-param name="options">scann,starr</control-param>                  
   <control-param name="forceEditable">true</control-param>
   </control>
</field>


I defined the field in the content model as follows:

     <property name="nci:sensor_recordMode">
        <title>Aufnahmeverfahren</title>
        <type>d:text</type>
        <mandatory>true</mandatory>
        <multiple>false</multiple>
        <index enabled="true">
            <atomic>true</atomic>
            <stored>true</stored>
            <tokenised>both</tokenised>
        </index>
    </property>
1 REPLY 1

mitpatoliya
Star Collaborator
Star Collaborator
well you can have LIST constrain on that property where only those values are permitted so if none of them are selected you will get error.