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

Tapestry overrides page methods that implement a superclass's abstract method

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 4.1.1
    • 4.1.7
    • Framework
    • None

    Description

      If you have an abstract accessor method in a page class, then implement the getter in the subclass, then call that method in an OGNL expression on the page, the implemented method never gets called. Instead, Tapestry overrides it when it enhances the page class with its own version. Tapestry should not override existing methods on page classes. An example follows. Bug is fixed when MySubclassPage displays "Fixed" instead of "Borken".
      _____

      MySuperclassPage.java
      public abstract class MySuperclassPage extends org.apache.tapestry.html.BasePage {
      public abstract boolean isMyBooleanProperty();
      }
      _____

      MySubclassPage.java
      public abstract class MySubclassPage extends MySuperclassPage {
      public boolean isMyBooleanProperty()

      { return true; // This never gets called }

      }
      _____

      MySubclassPage.html
      <span jwcid="@Insert" value="ognl:myBooleanProperty ? 'Fixed' : 'Borken'" />
      _____

      MySubclassPage.page
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE page-specification PUBLIC
      "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
      "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
      <page-specification class="mypackage.MySubclassPage">
      </page-specification>

      Attachments

        Activity

          People

            Unassigned Unassigned
            rwalker Robert J. Walker
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: