Ayub Malik
Ayub Malik

Reputation: 2578

Orbeon add unique constraint to repeat grid

Given I have an Orbeon Form with a repeating grid/element named promo-slots with single control slot, is there a way to add a constraint so that each slot has a unique value?

I have tried following constraint, but it is not valid.

count(/form/promo-slots/slot[text() = .]) = 1

Here is the XForm instance definition

<xf:instance id="fr-form-instance">
<form>
    <id/>
    <title/>                       
    <promo-slots>
        <slot/>
        <slot/>
        <slot/>
        <slot/>
    </promo-slots>
</form>
</xf:instance>

Upvotes: 1

Views: 343

Answers (1)

Jez
Jez

Reputation: 274

Compare the value against "slot" values, but except the current control:

not (. = (../../promo-slots/slot except .))

Regards

Jez

Upvotes: 2

Related Questions