Example #1
0
 /**
  * returns a smartgwt SelectItem with the name field for the formField value descriptor.
  *
  * @param field
  * @param formField
  * @param valueMap The selection possibilities.
  * @return
  */
 protected FormItem createSelectField(
     String field, UIFormFieldValue formField, LinkedHashMap<String, String> valueMap) {
   FormItem res = new SelectItem(field, formField.getLabel());
   res.setValueMap(valueMap);
   res.setValue((String) formField.getValue());
   return res;
 }
 private void setSelectItems(FormItem si, ArrayList<ClSelectionItem> items) {
   if (items == null) {
     items = new ArrayList<ClSelectionItem>();
   }
   LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
   map.put("-1", "---");
   for (ClSelectionItem item : items) {
     map.put(item.getId() + "", item.getValue());
   }
   si.setValueMap(map);
   si.setValue("-1");
 }
 public static void setSelectItems(FormItem si, ArrayList<ClSelectionItem> items) {
   if (items == null) {
     items = new ArrayList<ClSelectionItem>();
   }
   if (si instanceof ChkGridItem) {
     ((ChkGridItem) si).setItems(items);
     return;
   }
   LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
   for (ClSelectionItem item : items) {
     map.put(item.getId() + "", item.getValue());
   }
   si.setValueMap(map);
 }