interface icon indicating copy to clipboard operation
interface copied to clipboard

Value or empty relation assertion hidden field

Open VojtaStanek opened this issue 3 years ago • 0 comments

Should be useful when we have DiscriminatedBlocks and use different set of fields in each block and we want to unset fields or relations not used in the block and we want to unset them when we change type.

Illustrative example:

<DiscriminatedBlocks field="type" label="Type" >
    <Block discriminateBy="typeA" label="Type A">
        <SelectField label="Some useful stuff" field="fieldOnTypeA" options="Foo.bar" />
        <AssertNull field="fieldOnTypeB" />
    </Block>
    <Block discriminateBy="typeB" label="Type B">
        <SelectField label="Different stuff" field="fieldOnTypeB" options="Foo.bar" />
        <AssertNull field="fieldOnTypeA" />
    </Block>
</DiscriminatedBlocks>

VojtaStanek avatar Oct 25 '21 17:10 VojtaStanek