Package de.odysseus.calyxo.forms

Examples of de.odysseus.calyxo.forms.Form


    FormInputValues inputs) throws Exception {

    I18nSupport i18n = I18nSupport.getInstance(request);
    Locale locale = i18n.getLocale(request);     
    FormsSupport support = FormsSupport.getInstance(request);
    Form form = support.getForm(request, locale, mapping.getPath());
    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()) {
View Full Code Here


          }
        } catch (Exception e) {
          throw new JspException(e);
        }
      } else {
        Form form = support.getForm(request, action);
        if (form == null) {
          throw new JspException("Cannot find form for action '" + action + "'!");
        }
        try {
          Iterator inputs = form.getFormInputs();
          while (inputs.hasNext()) {
            FormInput input = (FormInput)inputs.next();
            Object value = input.format(request, formData);
            if (input.isArray()) {
              values._setInputs(input.getName(), (String[])value);
View Full Code Here

   
    String path = config.getActionConfig().getPath();

    // validate form
    log.debug("validating form for action '" + path + "'");
    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) {
View Full Code Here

TOP

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

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.