Announcement

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

    RadioGroupItem Obsidian Theme Issue

    Hi Isomorphic,

    We seem to have some quirk with the Obsidian theme for the RadioGroupItem.

    SmartClient Version: v12.1p_2022-11-14/Pro Deployment (built 2022-11-14)

    The default value doesn't appear selected for Obsidian, whereas, for Stratus it does.


    Stratus

    Click image for larger version

Name:	stratus_radiogroup.png
Views:	34
Size:	5.3 KB
ID:	269071

    Obsidian

    Click image for larger version

Name:	obsidian_radiogroup.png
Views:	29
Size:	5.7 KB
ID:	269072

    Code:
    package com.sandbox.client;
    
    import java.util.HashMap;
    import java.util.LinkedHashMap;
    import java.util.Map;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.user.client.Cookies;
    import com.google.gwt.user.client.Window;
    import com.google.gwt.user.client.ui.RootPanel;
    import com.smartgwt.client.widgets.form.DynamicForm;
    import com.smartgwt.client.widgets.form.fields.RadioGroupItem;
    import com.smartgwt.client.widgets.form.fields.SelectItem;
    import com.smartgwt.client.widgets.layout.Layout;
    import com.smartgwt.client.widgets.layout.VLayout;
    
    public class Sandbox27 implements EntryPoint {
    
        public void onModuleLoad() {
            Layout vLayout = new VLayout();
            DynamicForm form = new DynamicForm();
    
            SelectItem selectItem = new SelectItem("skin", "Choose Skin");
            selectItem.setWidth(130);
            LinkedHashMap<String, String> valueMap = new LinkedHashMap<>();
            valueMap.put("Enterprise", "Enterprise");
            valueMap.put("Stratus", "Stratus");
            valueMap.put("Tahoe", "Tahoe");
            valueMap.put("Obsidian", "Obsidian");
    
            selectItem.setValueMap(valueMap);
    
            String currentSkin = Cookies.getCookie("skin");
    
            if (currentSkin == null) {
                currentSkin = "Enterprise";
            }
            selectItem.setDefaultValue(currentSkin);
            selectItem.setStartRow(true);
            selectItem.addChangedHandler(event -> {
                Cookies.setCookie("skin", event.getValue().toString());
                Window.Location.reload();
            });
    
            form.setWidth(200);
            form.setHeight(200);
    
            Map<Integer, String> radioMap = new HashMap<>();
            radioMap.put(0, "Option 1");
            radioMap.put(1, "Option 2");
    
            RadioGroupItem fieldRestriction = new RadioGroupItem("Radio Options");
            fieldRestriction.setRedrawOnChange(Boolean.TRUE);
            fieldRestriction.setStartRow(Boolean.TRUE);
            fieldRestriction.setValueMap(radioMap);
            fieldRestriction.setDefaultValue(0);
            fieldRestriction.setVertical(false);
    
            form.setItems(selectItem, fieldRestriction);
    
            vLayout.addMember(form);
    
            RootPanel.get().add(vLayout);
            vLayout.setWidth100();
            vLayout.setHeight100();
            vLayout.show();
        }
    }

    #2
    Thanks for the report - we see the issue and we'll update shortly when it's been fixed.

    Comment


      #3
      We've applied a fix for this issue - please retest with a build dated November 18 or later.

      Comment


        #4
        Hi Isomorphic,

        We are using SmartClient Version: v12.1p_2022-11-20/Pro Deployment (built 2022-11-20) and the issue with the RadioGroupItem is resolved, however, there is now an issue with the CheckboxItem defaulting to checked even when the value is false. The CheckboxItem works as expected with SmartClient Version: v12.1p_2022-11-14/Pro Deployment (built 2022-11-14).

        You can see this issue with showcase example here. The checkbox should be unchecked at first.

        Thanks.

        Comment


          #5
          Apologies - we have some internal shenanigans going on for the Obsidian skin, where we use CheckBoxItems rather than native radios so we can customize the background color.

          The issue was fixed for yesterday's builds, dated November 22, and we added some new autotests that were missing here - please let us know if you see any further issues.
          Last edited by Isomorphic; 23 Nov 2022, 09:36.

          Comment


            #6
            Both issues are resolved with the November 23 build. Thanks!

            Comment

            Working...
            X