Tapestry
  1. Tapestry
  2. TAPESTRY-1518

Add support for JDK 1.5 Generics when defining pages and accessing bean properties

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0, 5.0.3, 5.0.4
    • Fix Version/s: 5.0.10
    • Component/s: tapestry-core, tapestry-ioc
    • Labels:
      None

      Description

      Base.java

      class abstract Base<T>{
      private T entity;
      public void setEntity(T t)

      { this.entity=entity; }

      public T getEntity(T t)

      { return this.entity; }

      protected abstract Class<T> getEntityClass();
      onPrepareFromMyForm(){
      if(this.entity == null){
      try

      { this.entity=getEntityClass().newInstance(); }

      catch(Exception e)

      { throw new RuntimeException(e); }

      }
      }
      .....
      }

      ProductPage.java

      public class ProductPage extends Base<Product>{
      protected Class<Product> getEntityClass()

      { return Product.class; }

      }

      ProductPage.html

      <t:form t:id="MyForm">
      <t:errors/>
      <t:label for="input"/>
      <input t:type="textfield" t:id="input" value="entity.name" size="40" t:validate="required,minlength=3"/>
      <br/>
      <input type="submit" value="Submit"/>
      </t:form>

      exception:
      Could not convert 'entity.name' into a component parameter binding: Class java.lang.Object does not contain a property named 'name' (within property expression 'entity.name').

      When I debug the app,I fiind PropertyConduitSourceImpl.readMethodForTerm before onPrepareFromMyForm method.

      I think the method should be after onPrepareFromMyForm method.

        Issue Links

          Activity

            People

            • Assignee:
              Howard M. Lewis Ship
              Reporter:
              Jun Tsai
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development