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:
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
Say i have a server-side datasource with an enum field:
Code:
<field name="language" type="enum" required="true" defaultValue="1"> <title> <fmt:message key="language"/> </title> <valueMap> <value ID="0"> <fmt:message key="language.en"/> </value> <value ID="1"> <fmt:message key="language.se"/> </value> <value ID="2"> <fmt:message key="language.pl"/> </value> <value ID="3"> <fmt:message key="language.lv"/> </value> ...more </valueMap> </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
Comment