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

Properties defined in an Interface are not exposed by PropertyAccess for abstract classes that do not directly implement the methods

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.1.0.5
    • 5.2.2
    • tapestry-ioc
    • None

    Description

      Here is a simple example:

      public interface HasName {
      String getName();
      }

      public abstract class AbstractBean implements HasName {
      }

      public class TestPage {

      @Property
      private AbstractBean bean;

      public void onActivate() {
      bean = new AbstractBean() {
      public void setName(String name) {
      }
      };
      }
      }

      TestPage.tml
      ...
      <h1>${bean.name}</h1>
      ...

      Error message is:

      Exception assembling root component of page manager/tools/TestPage: Could not convert 'bean.name' into a component parameter binding: Class smarter.ecommerce.smeco.manager.pages.tools.AbstractBean does not contain a property named 'name' (within property expression 'bean.name'). Available properties: class, componentResources.

      Everything works fine if I change the bean class to:

      public abstract class AbstractBean implements HasName {
      public abstract String getName();
      }

      Attachments

        Activity

          People

            joshcanfield Josh Canfield
            peter.rietzler@smarter-ecommerce.com Peter Rietzler
            Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: