Esempio n. 1
0
 @Override
 protected Layout addFields(FieldGroup fieldGroup) {
   Layout l = super.addFields(fieldGroup);
   Field id = (Field) fieldGroup.getField("id");
   id.setRequired(true);
   id.setRequiredError(getApp().getMessage("errorMessage.req", id.getCaption()));
   String idValue = (String) fieldGroup.getItemDataSource().getItemProperty("id").getValue();
   // Hide prefix
   if (idValue != null) { // Means it is not a new sysconfig entry
     id.setReadOnly(false);
     idValue = prefix != null ? idValue.substring(prefix.length()) : idValue;
     id.setValue(idValue);
     id.setReadOnly(true);
   }
   return l;
 }
Esempio n. 2
0
 public FieldQuery<F> setRequiredError(String error) {
   for (Field<?> f : this) {
     f.setRequiredError(error);
   }
   return createQuery();
 }