@Override public void setDataMap(Map<String, Object> data) throws FormEncodingException { super.setDataMap(data); this.name = (String) data.get("name"); this.rows = (data.get("rows") == null ? 0 : ((Number) data.get("rows")).intValue()); this.cols = (data.get("cols") == null ? 0 : ((Number) data.get("cols")).intValue()); this.value = (String) data.get("value"); this.id = (String) data.get("id"); }
@Override public void populate(FormItemRepresentation rep) throws FormBuilderException { if (!(rep instanceof ComboBoxRepresentation)) { throw new FormBuilderException( i18n.RepNotOfType(rep.getClass().getName(), "TextFieldRepresentation")); } super.populate(rep); ComboBoxRepresentation crep = (ComboBoxRepresentation) rep; List<OptionRepresentation> options = crep.getElements(); this.items.clear(); if (options != null) { for (OptionRepresentation option : options) { this.items.put(option.getLabel(), option.getValue()); this.listBox.addItem(option.getLabel(), option.getValue()); } } this.listBox.clear(); addItems(this.items, this.listBox); this.name = crep.getName(); this.id = crep.getId(); populate(this.listBox); }