No announcement yet.
  • Filter
  • Time
Clear All
new posts

    Need help conditionally disabling row in SelectItem

    Hi guys, been looking around in the forums and selectitem/picklist docs but i'm probably more confused than when i started.

    Say i have a server-side datasource with an enum field:
    <field name="language" type="enum" required="true" defaultValue="1">
                    <fmt:message key="language"/>
                    <value ID="0">
                        <fmt:message key="language.en"/>
                    <value ID="1">
                        <fmt:message key=""/>
                    <value ID="2">
                        <fmt:message key=""/>
                    <value ID="3">
                        <fmt:message key=""/>
    I have a databound form with a SelectItem for that datasource field.

    I now need to disable (i.e. make a row not selectable) one or more values in the selectitem based on some other, external criteria, i.e i can't set it directly in the datasource file.

    Is there a way for me to conditionally add for example a criteria, in pseudocode "if ID=3 disable" or similar?

    I hope i am explaining my use case good enough. Cheers

    A valueMap is just a key <-> value mapping, there's nowhere to add additional data. So if you want to do anything that is per-value, you just make it into an optionDataSource, then you can add disabled markers, find pairings by criteria, etc.


      Right. thanks.