Esempio n. 1
0
 public DateTimeField(String id, IModel model) {
   super(id, model);
   setType(Date.class);
   PropertyModel dateFieldModel = new PropertyModel(this, "date");
   add(dateField = newDateTextField("date", dateFieldModel));
   dateField.add(new DatePicker());
   add(hoursField = new TextField("hours", new PropertyModel(this, "hours"), Integer.class));
   hoursField.add(NumberValidator.range(0, 24));
   hoursField.setLabel(new Model("hours"));
   add(minutesField = new TextField("minutes", new PropertyModel(this, "minutes"), Integer.class));
   minutesField.add(NumberValidator.range(0, 59));
   minutesField.setLabel(new Model("minutes"));
 }
Esempio n. 2
0
 public HTTPLayerConfig(String id, IModel<LayerInfo> model) {
   super(id, model);
   add(
       new CheckBox(
           ResourceInfo.CACHING_ENABLED,
           new MapModel(new PropertyModel(model, "resource.metadata"), "cachingEnabled")));
   TextField<Long> maxAge =
       new TextField<Long>(
           ResourceInfo.CACHE_AGE_MAX,
           new MapModel(new PropertyModel(model, "resource.metadata"), "cacheAgeMax"),
           Long.class);
   maxAge.add(NumberValidator.range(0, Long.MAX_VALUE));
   add(maxAge);
 }