i'd try to make isFinished() non-abstract in the SignupPage, and have it
throw a runtime exception to make sure the base class implementation is
never called

2007/6/6, Robert J. Walker <[EMAIL PROTECTED]>:

I have an application that allows users to sign up for our service. One
thing the application needs to do is determine whether it needs to continue
to the next page or if it has enough information already. For example, some
of our clients pay for some or all of the service at the corporate level. If
a franchisee signs up for service that is completely paid by corporate, we
can stop before asking for their payment info.

So there's an abstract base class for all the pages called SignupPage
which has an abstract method called isFinished(). This method should return
true if the "FINISH" button should be shown on this page instead of the
"Next" button. The individual page classes implement the isFinished() method
with whatever logic is needed to determine whether or not the user is
finished on that page.

So here's the problem: In the case above, if I put a breakpoint in my
page's implementation of the isFinished() method, it never gets hit. A
little reflection reveals that Tapestry is overriding the page class's
implementation of the isFinished() method with one of its own which is
always returning false, resulting in the application asking for payment
information from users who don't owe anything.

Making my implementation of isFinished() final results in a VerifyError
when I hit the page. If I instead make my implementation class non-abstract,
my IDE complains that I haven't implemented the clientId property, which to
my understanding is supposed to be provided by Tapestry. The
Locations.page file does not declare finished as a property or even
mention it.

So the questions are: 1) Why is Tapestry creating an implementation of
this method when one already exists, and 2) how do I make it stop? Relevant
bits of code follow.

Thanks,

Robert J. Walker


SignupPage.java
public abstract class SignupPage extends BasePage {
...
        public abstract boolean isFinished();
...
}
_____

Locations.java (one of several pages which extend SignupPage)
public abstract class Locations extends SignupPage {
...
        public boolean isFinished() {
                // My logic goes here; this never gets executed
        }
...
}
_____

Locations.html
...
<div jwcid="@If" condition="ognl:finished">
        <!-- Finish button -->
</div>
<div jwcid="@Else">
        <!-- Next button -->
</div>
...


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to