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()
}
_____
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>