What version of Tapestry? This was addressed in 5.0.14, I believe, to ensure that when overriding a base class event handler method, the method is not invoked twice.
On Mon, Apr 21, 2008 at 6:25 AM, Leon Derks <[EMAIL PROTECTED]> wrote: > Hi Davor, > > Indeed, I have a BasePage that implements the public void onActivate() > {}method. > > In my subpage I also have implemented the public void onActivate() {}. > The code in onActivate() of my subpage is executed twice. > > BASEPAGE: > public void onActivate() { > String pageName = resources.getPageName(); > breadCrumbHolder.checkBreadCrumbForRemove(pageName); > } > > SUBCLASS: > public void onActivate() { > logger.debug("OnActivate "); > products = productDAO.findAllByCategory(ProductCategory.Books); > if (logger.isDebugEnabled()) { > logger.debug("Nr of products: " + products.size()); > } > } > > This is the logging when I acces the page: > > [DEBUG] Products OnActivate > [DEBUG] Products Nr of products:: 43 > [DEBUG] Products OnActivate > [DEBUG] Products Nr of products:: 43 > > Leon > > Davor Hrg wrote: >> >> you have to be more specific, >> >> same OnActivate method will not be called more than once in normal >> circumastances, >> >> but overriding onActivate from a base class I belive can cause this ... >> >> some code would be useful. >> >> Davor Hrg >> >> On Mon, Apr 21, 2008 at 12:41 PM, Leon Derks <[EMAIL PROTECTED]> >> wrote: >> >> >>> >>> Hi, >>> >>> I noticed that my onActivate() is called twice. >>> >>> I solved the problem by changing onActivate() into onActivate(Object[] >>> parameters). >>> >>> Now it is only called once. But is this the way to do this or is there a >>> better way? >>> >>> greetings, >>> Leon >>> >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >>> >> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]