Package de.iritgo.aktera.ui.form

Examples of de.iritgo.aktera.ui.form.EditFormContext


    try
    {
      ModelRequestWrapper wrappedRequest = new ModelRequestWrapper(request);
      ModelResponseWrapper wrappedResponse = new ModelResponseWrapper(response);

      EditFormContext context = new EditFormContext();

      context.setRequest(wrappedRequest);

      readConfig();

      Object id = handler.getPersistentId(wrappedRequest, contextId, keyName);

      if (StringTools.isTrimEmpty(id) || request.hasParameter("new"))
      {
        id = new Integer(- 1);
      }

      context.setId(id);

      String persistentsId = FormTools.createContextKey(contextId, id);

      FormularDescriptor formular = createFormular(wrappedRequest);

      if (request.getParameter("page") != null)
      {
        formular.setPage(NumberTools.toInt(request.getParameter("page"), formular.getPage()));
      }

      if (NumberTools.toBool(request.getParameter("AKTERA_auto"), false)
              && request.getParameter("AKTERA_page") != null)
      {
        formular.setPage(NumberTools.toInt(request.getParameter("AKTERA_page"), formular.getPage()));
      }

      handler.prepareFormular(wrappedRequest, wrappedResponse, formular);

      PersistentDescriptor persistents = formular.getPersistents();
      context.setPersistents(persistents);

      if (persistents == null
              || (request.getParameter("error") == null && request.getParameter("reedit") == null && ! reeditAlways))
      {
        persistents = new PersistentDescriptor(persistentsId);
        context.setPersistents(persistents);

        for (Configuration configuration : attributeConfig)
        {
          String name = configuration.getAttribute("name");
          Object value = null;
          try
          {
            value = context.evalExpressionLanguageValue(configuration.getAttribute("value"));
            if (value != null)
            {
              persistents.putAttribute(name, value);
            }
          }
View Full Code Here

TOP

Related Classes of de.iritgo.aktera.ui.form.EditFormContext

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.