You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Dan Adams <da...@ifactory.com> on 2007/11/06 21:30:14 UTC

[t5] Firing a page activate event with a different event name?

How do you fire an event on a different page (like a normal page
activate event) but with a different name for the event (for instance,
'add' or 'edit' instead of 'activate')?

-- 
Dan Adams
Senior Software Engineer
Interactive Factory
617.235.5857


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [t5] Firing a page activate event with a different event name?

Posted by Massimo Lusetti <ml...@gmail.com>.
On Nov 6, 2007 10:16 PM, Howard Lewis Ship <hl...@gmail.com> wrote:

> This is not so cool ... I wonder if there's a way we could build a bit
> more of an event bus into Tapestry.  Now that Tapestry knows all the
> pages at startup, we could do some pretty sophisticated things:  Have
> annotations that register methods for application events, rather than
> page events.

So to interact with the flow of the application and render based on
event results...

> The framework could automatically load page instances in order to
> receive such events.

Could this be coming from other components and/or services only or
even from external calls like some sort of REST calls?

> It implies a bit more work at startup: all page classes will need to
> be transformed at startup, or at least, on first request.  It's an
> interesting idea though.

Very very interesting and very powerful...

-- 
Massimo
http://meridio.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [t5] Firing a page activate event with a different event name?

Posted by Massimo Lusetti <ml...@gmail.com>.
On Nov 9, 2007 2:02 AM, Howard Lewis Ship <hl...@gmail.com> wrote:

> However, and perhaps this is your point, we could extend the concept
> of marker annotations to pages and have a mechanism to inject based on
> the intersection of type (the interface) and marker.  But again, it

Precisely

> does require that all page classes be loaded and transformed at app
> startup (or first request). That's ok with 10 or 20 or maybe 50 pages,
> but it starts to impact the development cycle once you have 100 or
> 1000 pages.

Well I'm out here since I've never built a site with more the 72 page
of which more then the half where for Intranet (back office) access.

-- 
Massimo
http://meridio.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [t5] Firing a page activate event with a different event name?

Posted by Howard Lewis Ship <hl...@gmail.com>.
My point is that if you inject into a field whose type is an
interface, then you have to specify the page name.

However, and perhaps this is your point, we could extend the concept
of marker annotations to pages and have a mechanism to inject based on
the intersection of type (the interface) and marker.  But again, it
does require that all page classes be loaded and transformed at app
startup (or first request). That's ok with 10 or 20 or maybe 50 pages,
but it starts to impact the development cycle once you have 100 or
1000 pages.

On Nov 8, 2007 3:04 PM, Massimo Lusetti <ml...@gmail.com> wrote:
> On Nov 8, 2007 4:46 PM, Howard Lewis Ship <hl...@gmail.com> wrote:
>
> > To be honest, these kind of page-to-page interactions may be better
> > implemented as ordinary Java methods, rather than events:
>
> Right, so the events we are talking about are external, right? This
> seems to put a lot of power inside Tapestry5 to let us use in other
> forms like 'new age' web services :)
>
> > Page A injects page B and invokes arbitrary method m() on it.  This
> > can be made cleaner by defining method m() in an interface, perhaps
> > ... hm, then you have to use @InjectPage("pageb") which is less
> > refactoring-safe than if you match PageB by type.
>
> Here Guice and all the dust around has shown the way to go... don't you?
>
> --
> Massimo
> http://meridio.blogspot.com
>
> ---------------------------------------------------------------------
>
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship
Partner and Senior Architect at Feature50

Creator Apache Tapestry and Apache HiveMind

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [t5] Firing a page activate event with a different event name?

Posted by Massimo Lusetti <ml...@gmail.com>.
On Nov 8, 2007 4:46 PM, Howard Lewis Ship <hl...@gmail.com> wrote:

> To be honest, these kind of page-to-page interactions may be better
> implemented as ordinary Java methods, rather than events:

Right, so the events we are talking about are external, right? This
seems to put a lot of power inside Tapestry5 to let us use in other
forms like 'new age' web services :)

> Page A injects page B and invokes arbitrary method m() on it.  This
> can be made cleaner by defining method m() in an interface, perhaps
> ... hm, then you have to use @InjectPage("pageb") which is less
> refactoring-safe than if you match PageB by type.

Here Guice and all the dust around has shown the way to go... don't you?

-- 
Massimo
http://meridio.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [t5] Firing a page activate event with a different event name?

Posted by Howard Lewis Ship <hl...@gmail.com>.
To be honest, these kind of page-to-page interactions may be better
implemented as ordinary Java methods, rather than events:

Page A injects page B and invokes arbitrary method m() on it.  This
can be made cleaner by defining method m() in an interface, perhaps
... hm, then you have to use @InjectPage("pageb") which is less
refactoring-safe than if you match PageB by type.

On Nov 6, 2007 1:16 PM, Howard Lewis Ship <hl...@gmail.com> wrote:
> You can get the page, cast it to ComponentResourcesAware to get the
> ComponentResources.  At that point, you can invoke triggerEvent().
>
> This is not so cool ... I wonder if there's a way we could build a bit
> more of an event bus into Tapestry.  Now that Tapestry knows all the
> pages at startup, we could do some pretty sophisticated things:  Have
> annotations that register methods for application events, rather than
> page events.
>
> The framework could automatically load page instances in order to
> receive such events.
>
> It implies a bit more work at startup: all page classes will need to
> be transformed at startup, or at least, on first request.  It's an
> interesting idea though.
>
>
> On Nov 6, 2007 12:30 PM, Dan Adams <da...@ifactory.com> wrote:
> > How do you fire an event on a different page (like a normal page
> > activate event) but with a different name for the event (for instance,
> > 'add' or 'edit' instead of 'activate')?
> >
> > --
> > Dan Adams
> > Senior Software Engineer
> > Interactive Factory
> > 617.235.5857
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
>
> --
> Howard M. Lewis Ship
> Partner and Senior Architect at Feature50
>
> Creator Apache Tapestry and Apache HiveMind
>



-- 
Howard M. Lewis Ship
Partner and Senior Architect at Feature50

Creator Apache Tapestry and Apache HiveMind

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [t5] Firing a page activate event with a different event name?

Posted by Howard Lewis Ship <hl...@gmail.com>.
You can get the page, cast it to ComponentResourcesAware to get the
ComponentResources.  At that point, you can invoke triggerEvent().

This is not so cool ... I wonder if there's a way we could build a bit
more of an event bus into Tapestry.  Now that Tapestry knows all the
pages at startup, we could do some pretty sophisticated things:  Have
annotations that register methods for application events, rather than
page events.

The framework could automatically load page instances in order to
receive such events.

It implies a bit more work at startup: all page classes will need to
be transformed at startup, or at least, on first request.  It's an
interesting idea though.

On Nov 6, 2007 12:30 PM, Dan Adams <da...@ifactory.com> wrote:
> How do you fire an event on a different page (like a normal page
> activate event) but with a different name for the event (for instance,
> 'add' or 'edit' instead of 'activate')?
>
> --
> Dan Adams
> Senior Software Engineer
> Interactive Factory
> 617.235.5857
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship
Partner and Senior Architect at Feature50

Creator Apache Tapestry and Apache HiveMind

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org