Ejemplo n.º 1
0
 /**
  * Convert the input respecting the flag convertEmptyInputStringToNull. Subclasses that override
  * this method should test this flag also.
  *
  * @see org.apache.wicket.markup.html.form.FormComponent#convertInput()
  */
 @Override
 protected void convertInput() {
   // Stateless forms don't have to be rendered first, convertInput could be called before
   // onBeforeRender calling resolve type here again to check if the type is correctly set.
   resolveType();
   String[] value = getInputAsArray();
   String tmp = value != null && value.length > 0 ? value[0] : null;
   if (getConvertEmptyInputStringToNull() && Strings.isEmpty(tmp)) {
     setConvertedInput(null);
   } else {
     super.convertInput();
   }
 }
Ejemplo n.º 2
0
 /**
  * If the type is not set try to guess it if the model supports it.
  *
  * @see org.apache.wicket.Component#onBeforeRender()
  */
 @Override
 protected void onBeforeRender() {
   super.onBeforeRender();
   resolveType();
 }