Package de.odysseus.calyxo.forms

Examples of de.odysseus.calyxo.forms.FormsSupport


    String action,
    FormComponentStyles styles,
    boolean create) throws Exception {
    super();

    FormsSupport support = FormsSupport.getInstance(request);
   
    form = support.getForm(request, action);
    if (form == null) {
      throw new ConfigException("Cannot find form for action'" + action + "'!");
    }
    result = support.getFormResult(request, action);
    if (result == null) {
      data = support.getFormData(request, action, create);
    } else {
      data = null;
    }

    this.request = request;
View Full Code Here


    ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response) throws Exception {

    FormsSupport support = FormsSupport.getInstance(request);
    FormProperties properties =
      support.getFormProperties(request, mapping.getPath());
    properties.commit();

    return new ActionForward(mapping.getInput());
  }
View Full Code Here

*/
public class FlushTag extends TagSupport {

  public int doEndTag() throws JspException {
    HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
    FormsSupport support = FormsSupport.getInstance(request);

    FormTag formTag = (FormTag)findAncestorWithClass(this, FormTag.class);
    if (formTag == null) {
      throw new JspException("Cannot get enclosing form tag");
    }
    String action = formTag.getAction();
     
    FormData formData = null;
    try {
      formData = support.getFormData(request, action, false);
    } 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()) {
              values._setInputs(input.getName(), (String[])value);
            } else {
              values._setInput(input.getName(), (String)value);
            }
          }
        } 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();
View Full Code Here

    HttpServletRequest request,
    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
View Full Code Here

TOP

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

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.