Announcement

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

    ValueMap with large integer value not sorting consistently across browsers.

    We have a value map with large integer values. Once we reach a specific ID/value threshold, the sort becomes inconsistent across browsers.

    For example, if we have the following value map defined below, on Firefox, the values appear in the SelectItem ordered by their defined order in the value map, specifically, "A, B, C, D, E, ...". In Chrome and IE11, they appear ordered by the integer ID, specifically, "A, B, C, E, H, ...". If we remove all values with ID greater than or equal to "16384", the values are sorted in the SelectItem by ID consistently across all browsers.

    Code:
    <field name="aField" type="integer" multiple="true">
        <valueMap>
            <value ID="1">A</value>
            <value ID="2">B</value>
            <value ID="4">C</value>
            <value ID="524288">D</value>
            <value ID="8">E</value>
            <value ID="4194304">F</value>
            <value ID="32768">G</value>
            <value ID="16">H</value>
            <value ID="131072">I</value>
            <value ID="32">J</value>
            <value ID="64">K</value>
            <value ID="128">L</value>
            <value ID="65536">M</value>
            <value ID="256">N</value>
            <value ID="512">O</value>
            <value ID="262144">P</value>
            <value ID="1024">Q</value>
            <value ID="2048">R</value>
            <value ID="4096">S</value>
            <value ID="8192">T</value>
            <value ID="16384">U</value>
        </valueMap>
    </field>
    In some cases, we may want the values in the SelectItem ordered by ID and in some cases we may want the values ordered in their defined ordered.

    1. Is there an explanation for the inconsistency between browsers?

    2. Is there a way on a SelectItem to control the order in which the values appear in the SelectItem (i.e defined order vs. ID order)?

    SmartClient Version: v9.1p_2014-08-11/Pro Deployment (built 2014-08-11)

    Thanks

    #2
    This looks like a red herring, and the issue is actually the same as with your other post today.

    You *would* have ordering issues if you actually exceeded the range of JavaScript's Number type. But that's several orders of magnitude higher that the values you're using.

    Comment


      #3
      Thanks for the update, I do have a related issue though...

      For the following valueMap, I would have expected the order in the SelectItem to be "-- System Default --, 5,...,20,Unlimited", however, I am getting "5,...,20,Unlimited,-- System Default --" on Firefox (24.7.0) and Chrome (Version 36.0.1985.125).

      Code:
      <field name="threshold" type="integer" defaultValue="-2">
          <valueMap>
              <value ID="-2">-- System Default --</value>
              <value ID="5">5</value>
              <value ID="6">6</value>
              <value ID="7">7</value>
              <value ID="8">8</value>
              <value ID="9">9</value>
              <value ID="10">10</value>
              <value ID="11">11</value>
              <value ID="12">12</value>
              <value ID="13">13</value>
              <value ID="14">14</value>
              <value ID="15">15</value>
              <value ID="16">16</value>
              <value ID="17">17</value>
              <value ID="18">18</value>
              <value ID="19">19</value>
              <value ID="20">20</value>
              <value ID="100">Unlimited</value>
          </valueMap>
      </field>

      Comment


        #4
        Yup, same issue with native behavior of keys. To clarify, keys parsable as *positive* integers are popped out of the definition order and placed first. Anything not parsable as a positive integer (like -2) appears in definition order.

        Comment


          #5
          Thanks for the clarification.

          Comment

          Working...
          X