Package de.odysseus.calyxo.forms

Examples of de.odysseus.calyxo.forms.FormInputResult


      s.append("<th align=\"left\">Input</th>");
      s.append("<th align=\"left\">Property</th>");
      s.append("<th align=\"left\">Value/Msg</th>");
      Iterator values = result.getFormInputResults();
      while (values.hasNext()) {
        FormInputResult value = (FormInputResult)values.next();
        s.append("<tr><td>");
        s.append(value.getFormInput().getName());
        s.append("</td><td>");
        s.append(value.getProperty());
        s.append("</td><td>");
        if (value.isValid()) {
          Object o = value.getValue();
          String f = toString(o);
          if (f.length() > 60) {
            f = f.substring(0, 60) + "...";
          }
          s.append(f);
        } else {
          s.append(value.getFirstMessage());
        }
        s.append("</td></tr>");
      }
      s.append("</table>");
    } else {
View Full Code Here


  private Map getInput() {
    if (input == null) {
      input = new MapFacade() {
        public Object get(Object key) {
          String name = (String)key;
          FormInputResult result =
            formResult.getFormInputResult(name);
          if (result == null) {
            throw new NoSuchElementException("Bad input name: " + name);
          }
          FormInput input = result.getFormInput();
          involvedInputs.add(input);
          if (input.isArray()) {
            return inputValues._getInputs(name);
          } else {
            return inputValues._getInput(name);
View Full Code Here

          String property = (String)key;
          FieldConfig field = formResult.getFormConfig().findFieldConfig(property);
          if (field == null) {
            throw new NoSuchElementException("Bad property name: " + key);
          }
          FormInputResult result =
            formResult.getFormInputResult(field.getName());
          FormInput input = result.getFormInput();
          involvedInputs.add(input);
          if (!result.isValid()) {
            invalidPropertyReferenced = true;
            return null;
          }
          if (!result.getProperty().equals(property)) {
            return null;
          }
          return result.getValue();
        }
      };
    }
    return property;
  }
View Full Code Here

      int index = component.getIndex();
      if (index < 0) {
        throw new ConfigException("Input '" + component.getName() + "' has no index");
      }
      if (result != null) {
        FormInputResult inputResult = result.getFormInputResult(component.getName());
        if (index >= inputResult.getSize()) {
          return NOT_AVAILABLE;
        }
        return inputResult.format(request, index);
      } else if (data != null) {
        return input.format(request, data, index, NOT_AVAILABLE);
      }
    } else {
      if (result != null) {
View Full Code Here

  /**
   * Answer true iff the specified component is valid.
   */
  private boolean isValidOrRelaxed(FormComponent component) {
    if (result != null) {
      FormInputResult inputResult = result.getFormInputResult(component.getName());
      if (inputResult.isRelaxed()) {
        return true;
      }
      int index = component.getIndex();
      return index < 0 ? inputResult.isValid() : inputResult.isValid(index);
    }
    return true;
  }
View Full Code Here

      FormResult result = support.getFormResult(request, action);
      if (result != null) {
        try {
          Iterator inputs = result.getFormInputResults();
          while (inputs.hasNext()) {
            FormInputResult inputResult = (FormInputResult)inputs.next();
            FormInput input = inputResult.getFormInput();
            Object value = inputResult.format(request);
            if (input.isArray()) {
              values._setInputs(input.getName(), (String[])value);
            } else {
              values._setInput(input.getName(), (String)value);
            }
View Full Code Here

TOP

Related Classes of de.odysseus.calyxo.forms.FormInputResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.