List of usage examples for com.google.gwt.dom.client SelectElement getValue
public String getValue()
From source file:org.swellrt.webclient.WebClientMod.java
License:Apache License
private void setupLocaleSelect() { final SelectElement select = (SelectElement) Document.get().getElementById("lang"); String currentLocale = LocaleInfo.getCurrentLocale().getLocaleName(); String[] localeNames = LocaleInfo.getAvailableLocaleNames(); for (String locale : localeNames) { if (!DEFAULT_LOCALE.equals(locale)) { String displayName = LocaleInfo.getLocaleNativeDisplayName(locale); OptionElement option = Document.get().createOptionElement(); option.setValue(locale);/*from w w w . ja v a 2 s .co m*/ option.setText(displayName); select.add(option, null); if (locale.equals(currentLocale)) { select.setSelectedIndex(select.getLength() - 1); } } } EventDispatcherPanel.of(select).registerChangeHandler(null, new WaveChangeHandler() { @Override public boolean onChange(ChangeEvent event, Element context) { UrlBuilder builder = Location.createUrlBuilder().setParameter("locale", select.getValue()); Window.Location.replace(builder.buildString()); localeService.storeLocale(select.getValue()); return true; } }); }
From source file:uk.ac.ebi.fg.annotare2.web.gwt.editor.client.view.widget.EditSelectionCell.java
License:Apache License
private String updateViewData(Element parent, ViewData viewData, boolean isEditing) { SelectElement select = parent.getFirstChild().cast(); String newValue = options.get(Integer.decode(select.getValue())); viewData.setText(newValue);/*from w w w. jav a 2 s . c o m*/ viewData.setEditing(isEditing); return newValue; }