0

I have a use case for the type-ahead feature of xe:djComboBox, but I want to limit the entered value to the selectItems for the control. In the following code example the selectItems returns the 50 States from Domino View data source called viewStates. I tried to validate the selected/value using the validator in the code, but any entered value is still accepted. Any ideas?

<xe:djComboBox id="djComboBox2"
                value="#{document1.Text_3}" ignoreCase="true"
                promptMessage="Type or select a State"
                invalidMessage="Not a valid State selection"
                validator="#{javascript:(@IsMember(this.getValue(),viewStates.getColumnValues(0)))? true : false;}">


                <xp:selectItem itemLabel=""></xp:selectItem>
                <xp:selectItems>
                    <xp:this.value><![CDATA[#{javascript:viewStates.getColumnValues(0)}]]></xp:this.value>
                </xp:selectItems>

            </xe:djComboBox>

4 Answers4

3

Use the xe:djFilteringSelect control instead. It limits possible entries to those in selectItem and selectItems.

Per Henrik Lausten
  • 21,331
  • 3
  • 29
  • 76
1

Paul, look at the PickerValidator under Validators.

Howard
  • 1,503
  • 7
  • 16
1

As per Howard's suggestion this worked ...

<xe:djComboBox
        id="djComboBox2"
        ignoreCase="true"
        promptMessage="Type or select a State"
        invalidMessage="Not a valid State selection">


        <xe:this.validators>
            <xe:pickerValidator message="Enter the right state">
                <xe:this.dataProvider>
                    <xe:dominoViewNamePicker
                        viewName="USStates"
                        labelColumn="abbreviation">
                    </xe:dominoViewNamePicker>
                </xe:this.dataProvider>
            </xe:pickerValidator>
        </xe:this.validators>
        <xp:selectItem itemLabel=""></xp:selectItem>
        <xp:selectItems>
            <xp:this.value><![CDATA[#{javascript:viewStates.getColumnValues(0)}]]></xp:this.value>
        </xp:selectItems>

    </xe:djComboBox>
0

You are using the "Validator" property where you need to be using one of the "Validators" properties like customValidator.