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
Obsidian
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
Obsidian
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(); } }
Comment