Tapestry 5
  1. Tapestry 5
  2. TAP5-105

Defining a component in the class that does not appear in the template should be an exception (not a logged, and ignored, warning)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 5.0.15
    • Fix Version/s: 5.0.16
    • Component/s: None
    • Labels:
      None

      Description

      I just spent quite some time to find a bug in my code.

      In my .tml I use a <t:BeanEditForm>. As soon as I added
      @Component
      private Form form;
      to the corresponding .java file (need to do some validation), the form was no longer rendered (the rest of the page was there, only the form was missing). Of course, using
      @Component
      private BeanEditForm form;
      instead fixes the problem.

      It took me long to find the problem, because there was no hint of what I was doing wrong. Maybe Tapestry could be enhanced to generate some kind of error message or warning in case of such misaligned component classes, instead of quietly dropping the form.

      Of course, enhancing the system to be able to use Form instead of BeanEditForm if you need just the basic features of Form, and not BeanEditForm in your java code, would be even better, but this seems difficult, as Form is not a super-class of BeanEditForm.

        Issue Links

          Activity

          Christoph Jäger created issue -
          Davor Hrg made changes -
          Field Original Value New Value
          Link This issue blocks TAPESTRY-2170 [ TAPESTRY-2170 ]
          Hide
          Davor Hrg added a comment -

          part of this is resolved in TAPESTRY-2170

          Show
          Davor Hrg added a comment - part of this is resolved in TAPESTRY-2170
          Howard M. Lewis Ship made changes -
          Affects Version/s 5.0 [ 12312018 ]
          Howard M. Lewis Ship made changes -
          Affects Version/s 5.0 [ 12312018 ]
          Issue Type Improvement [ 4 ] Bug [ 1 ]
          Component/s tapestry-core [ 12311285 ]
          Key TAPESTRY-2233 TAP5-105
          Fix Version/s 5.0.10 [ 12312936 ]
          Project Tapestry [ 10573 ] Tapestry 5 [ 12310833 ]
          Howard M. Lewis Ship made changes -
          Affects Version/s 5.0.15 [ 12313429 ]
          Howard M. Lewis Ship made changes -
          Assignee Howard M. Lewis Ship [ hlship ]
          Howard M. Lewis Ship made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          Howard M. Lewis Ship added a comment -

          I'm very sure that you would see a warning for this in the current code, but (since warnings are always ignored), I'm upgrading it to a thrown exception.

          Show
          Howard M. Lewis Ship added a comment - I'm very sure that you would see a warning for this in the current code, but (since warnings are always ignored), I'm upgrading it to a thrown exception.
          Howard M. Lewis Ship made changes -
          Summary No error / warning when using @Component Form instead of BeanEditForm Defining a component in the class that does not appear in the template should be an exception (not a logged, and ignored, warning)
          Hide
          Howard M. Lewis Ship added a comment -

          BTW, your example creates TWO BeanEditForm instances; one via <t:beaneditform> and one via @Component.

          What you should do is either:

          @InjectComponent
          private BeanEditForm form;

          <t:beaneditform t:id="form"/>

          OR

          @Component
          private BeanEditForm form;

          <form t:id="form"/>

          Show
          Howard M. Lewis Ship added a comment - BTW, your example creates TWO BeanEditForm instances; one via <t:beaneditform> and one via @Component. What you should do is either: @InjectComponent private BeanEditForm form; <t:beaneditform t:id="form"/> OR @Component private BeanEditForm form; <form t:id="form"/>
          Howard M. Lewis Ship made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]
          Fix Version/s 5.0.16 [ 12313427 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open In Progress In Progress
          237d 22h 11m 1 Howard M. Lewis Ship 28/Oct/08 18:47
          In Progress In Progress Closed Closed
          59m 38s 1 Howard M. Lewis Ship 28/Oct/08 19:47

            People

            • Assignee:
              Howard M. Lewis Ship
              Reporter:
              Christoph Jäger
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development