Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-2634

Form component does not work when a mixin is applied

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 5.0.14
    • None
    • tapestry-core
    • None
    • Jetty 6, Tapestry 5.0.14, Windows XP, Sun Java 1.6

    Description

      As you can see in the attached example application, a very simple for component does
      not work when a mixin is applied.

      I have no clue what's going on here, but it's definetly not expected behaviour.

      Attachments

        1. t5-simple.zip
          12 kB
          Andy Pahne

        Activity

          ap@sapida.de Andy Pahne added a comment -

          Attached a demo project, so that the behaviour can be examined.

          First have a look at the SimpleMixin class. As you can see, it's one of the simplest mixins that you may think of.

          Then have a look at the "ExampleWithoutMixin" page. It has the desired behaviour.

          At last, try out the ExampleWithMixin page. It's the same as the page that works. The only difference is the mixin used.

          ap@sapida.de Andy Pahne added a comment - Attached a demo project, so that the behaviour can be examined. First have a look at the SimpleMixin class. As you can see, it's one of the simplest mixins that you may think of. Then have a look at the "ExampleWithoutMixin" page. It has the desired behaviour. At last, try out the ExampleWithMixin page. It's the same as the page that works. The only difference is the mixin used.

          So let me get this straight ... I'm supposed to do detective work just to figure out what you expect to happen?

          Please read this and try again:

          http://www.catb.org/~esr/faqs/smart-questions.html

          hlship Howard Lewis Ship added a comment - So let me get this straight ... I'm supposed to do detective work just to figure out what you expect to happen? Please read this and try again: http://www.catb.org/~esr/faqs/smart-questions.html
          ap@sapida.de Andy Pahne added a comment -

          No, of course you are not supposed to do anything.

          I just wanted to let you know that a form does not work if a mixn wraps a simple tag around it. Just that.

          ap@sapida.de Andy Pahne added a comment - No, of course you are not supposed to do anything. I just wanted to let you know that a form does not work if a mixn wraps a simple tag around it. Just that.

          Yes, but "does not work" can mean just about anything. Does it misbehave? Throw an exception? Crash your computer?

          hlship Howard Lewis Ship added a comment - Yes, but "does not work" can mean just about anything. Does it misbehave? Throw an exception? Crash your computer?
          ap@sapida.de Andy Pahne added a comment -

          I apologize for being too unspecific.

          "Does not work" should mean: the page property

          @Property @Persist
          private String simpleProperty;

          is not updated by the form, when the mixin is used.

          It should be, as you can see by looking at the form's definition:

          <form t:type="Form" t:zone="resultZone" t:mixins="SimpleMixin">

          <t:label for="searchTerm"/>
          <input t:type="TextField"
          t:value="simpleProperty"
          t:id="searchTerm"/>

          <input t:type="submit"
          t:clientId="Submit"
          t:id="submitButton"
          value="Submit"/>

          </form>

          No exceptions were thrown. There were no error messages. But when the zone is updated after form submission, only the page without mixin does update the page property.

          Because both pages only differ in the mixin that is applied to the form component, I suspect that the mixin is the reason that the TextField does not update the page property. But that's just a guess, and my knowledge about T5 is still limited.

          ap@sapida.de Andy Pahne added a comment - I apologize for being too unspecific. "Does not work" should mean: the page property @Property @Persist private String simpleProperty; is not updated by the form, when the mixin is used. It should be, as you can see by looking at the form's definition: <form t:type="Form" t:zone="resultZone" t:mixins="SimpleMixin"> <t:label for="searchTerm"/> <input t:type="TextField" t:value="simpleProperty" t:id="searchTerm"/> <input t:type="submit" t:clientId="Submit" t:id="submitButton" value="Submit"/> </form> No exceptions were thrown. There were no error messages. But when the zone is updated after form submission, only the page without mixin does update the page property. Because both pages only differ in the mixin that is applied to the form component, I suspect that the mixin is the reason that the TextField does not update the page property. But that's just a guess, and my knowledge about T5 is still limited.

          People

            Unassigned Unassigned
            ap@sapida.de Andy Pahne
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: