Announcement

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

    Numeric Values in RadioGroupItem

    Hi,
    When numeric values used to populate value map of radiogroupitem, Smart GWT does not respect the insertion order of the values which causes an unexpected result on UI.
    This issue mentioned in previous years, and provided solution seems to be using optionDataSource as mentioned in RadioGroupItem sorts the value Map according to the Keys in value map - SmartClient Forums
    However RadioGroupItem also does not seem to work with optionDataSource which is also mentioned before in RadioGroupItem optionDataSource - SmartClient Forums

    I would like to learn the officially suggested solution of this problem?
    Last edited by mfbayraktar; 12 Jun 2025, 11:02.

    #2
    The previously suggested official solution remains the official solution. Note that it is quite easy to apply, as you can just use a clientOnly DataSource.

    Comment


      #3
      The problem is that optionDataSource with client only datasource does not work with radiogroupitem. So how it can be the solution?

      Comment


        #4
        Sorry for the delay on this. The only solution is to make the value keys non-numeric, that is, use "1A", "2A" etc instead of 1, 2, etc.

        The underlying problem is that JavaScript Objects respect key order unless the key can be parsed as a number. This was a very, very stupid behavior change introduced in Chrome some years ago, as an "optimization".

        If we did not use JavaScript Object for things like valueMaps, and instead used a more complex structure, everything would slow way down. So we are all stuck with this niggle, thanks to Chrome's decision.

        Comment

        Working...
        X