Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1393

Form component shoould push the BeanValidationContext into the Environment only after onPrepare()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.2.4
    • 5.3
    • tapestry-beanvalidator
    • None

    Description

      An exception is throw when trying to render a Form whose validate parameter is bound to a bean that is null after onActivate():

      ERROR tapestry.render.br.com.eteg.cromoup.pages.acesso.EditarPermissao - Render queue error in BeginRender[acesso/EditarPermissao:nome]: Class cannot be null

      The attached files show a scenario where the bug occur. Basically it shows an edit page that initialize a bean (that is bound to the validate parameter of the Form) at onValidate() if a not-null id is passed as the initialization context. If the id is null the bean is initialized at onPrepare(), just after the Form starts to render itself. The problem seems to happen because the "prepare" (and "prepare_to_render") event are triggered after the Form component pushes a BeanValidationContextImpl into the Environment.

      Attachments

        1. EditarPermissao.java
          2 kB
          Matheus Eduardo Machado Moreira
        2. EditarPermissao.tml
          2 kB
          Matheus Eduardo Machado Moreira
        3. Permissao.java
          2 kB
          Matheus Eduardo Machado Moreira
        4. stacktrace.txt
          26 kB
          Matheus Eduardo Machado Moreira

        Activity

          People

            igor.drobiazko Igor Drobiazko
            matheus.emm Matheus Eduardo Machado Moreira
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: