Package de.odysseus.calyxo.forms

Examples of de.odysseus.calyxo.forms.FormResult


  }

  public int doEndTag() throws JspException {
    StringBuffer s = new StringBuffer();
    HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
    FormResult result =
      (FormResult)request.getAttribute(FormsSupport.FORM_RESULT_KEY);
    if (result != null) {
      s.append("<table>");
      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>");
View Full Code Here


    } catch (Exception e) {
      throw new JspException("Cannot get form data for action '" + action + "'!");
    }
    if (formData instanceof FlushableForm) {
      FlushableForm values = (FlushableForm)formData;
      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()) {
View Full Code Here

    if (form == null) {
      throw new ConfigException("No form for action '" + mapping.getPath() + "'");
    }
    ActionErrors errors = null;
    // execute validation
    FormResult result = form.validate(request, inputs);
    if (!result.isValid()) { // collect error messages
      errors = new ActionErrors();
      Messages messages = result.getMessages();
      Iterator names = messages.getKeys();
      while (names.hasNext()) {
        String name = (String)names.next();
        if (name != Messages.GLOBAL_KEY) {
          Message message = messages.getFirstMessage(name);
View Full Code Here

    Form form = formsSupport.getForm(request, path);
    if (form == null) {
      throw new ServletException("Cannot find form for action '" + path);
    }
    FormInputValues formParams = new RequestInputValues(request);
    FormResult result = form.validate(request, formParams);
    request.setAttribute(FormsSupport.FORM_RESULT_KEY, result);
    if (result.isValid()) {
      log.debug("valid: yes");
      FormProperties properties = formsSupport.getFormProperties(request, path);
      if (properties != null && commit) {
        properties.commit();
      }
      return command.execute(request, response);
    } else {
      log.debug("valid: no");
      messageSupport.setErrors(request, result.getMessages());
      return dispatch;
    }
  }
View Full Code Here

TOP

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

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.