Skip to main content

BIN pIlqb Documentation

  • Author:

  • Version: 7

  • Description: At least one field of 3 must have a value - Velocity grammar

  • Created: 2014-09-30

  • Modified: 2019-04-01

  • Source:

     Edit Bin W3C Schema Json-Schema Java Bean Code Default Value as XML

    Printers Embed Responsive

    <complexType name='ExampleAtLeastOne'  description='At least one field of 3 must have a value - Velocity grammar'>
        <field name='A' caption='A (int)' minOccurs='0' type='xs:int' extra:xml='attribute' extra:ctrl.emptyisnull='true' extra:form.maybenull='true'/>
        <field name='B' minOccurs='0' type='xs:string' extra:xml='attribute' extra:ctrl.emptyisnull='true' extra:form.maybenull='true'/>
        <field name='C' minOccurs='0' type='xs:date' extra:xml='attribute' extra:ctrl.emptyisnull='true' extra:form.maybenull='true'/>
        <constraint name='AtLeastOneMustHaveValue' category='boolean' selector='.'>
            <expression grammar='velocity'
    	             path=' #if($value.A || $value.B || $value.C) true #end' />
        </constraint>
    </complexType>