Announcement

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

    valueMap sequence attribute?

    Do you support any kind of sequence attribute directly on the valueMap value element that would override the order in which the values appear in a SelectItem?

    For example, it would be nice to be able to specify a sequence as follows so that the values appear in the order "A, B, C, D" instead of "D, C, B, A".

    Code:
    <field name="aField" type="integer" multiple="true">
        <valueMap>
            <value ID="1" sequence="4">D</value>
            <value ID="2" sequence="3">C</value>
            <value ID="4" sequence="2">B</value>
            <value ID="8" sequence="1">A</value>
        </valueMap>
    </field>
    SmartClient Version: v9.1p_2014-08-11/Pro Deployment (built 2014-08-11)

    Thanks

    #2
    The order you define the <value> elements is the order you will see in the UI *unless* you use integer-valued keys and want an order that is different from the integer order.

    Unfortunately this bizarre and surprising special treatment of integer keys is a result of a behavior change in JavaScript implemented by some vendors, which will still hope to see reversed. More background here.

    As mentioned in that other thread, if you need to use integer keys and the order must different from display order, you can use an optionDataSource. Then the order in which records are defined/returned is always the order in which they are displayed.

    Comment

    Working...
    X