Hi guys, I've been thinking about a "push" component for a while and I thought I might make a start when I got some free time. I will be using an abstraction on top of DWR's reverse ajax to achieve this.
Basically, it will look something like this: ItemsComponent.tml <div> <t:zone t:id="zone" t:mixins="push" t:pushId="items-${user.id}" t:pushEvent="doPush"> <t:loop source="items" item="item">${item.name}</t:loop> </t:zone> </div> public class ItemsComponent { @Property private List<Item> items; @Property private Item item; @SessionState @Property private User user; @InjectComponent private Zone zone; public Block doPush(List<Item> context) { this.items = context; return zone.getBody(); } } And at some point, an asynchronous process will call PushService.doPush(Object pushId, Object pushContext) which will fire "doPush" and update the zone. As part of this, I will need to do the following FROM A NON WEB THREAD 1. Get a component / page instance (using a path/id I stored earlier) 2. Execute an event on the component / page instance 3. Get the resultant block and run it through tapestry's template engine 4. Use DWR's reverse ajax to update the zone with the html fragment. A couple of questions: 5. The push mixin will be storing the pushId and pushEvent in DWR's http://directwebremoting.org/dwr/javadoc/org/directwebremoting/ScriptSession.html ScriptSession . I will also need a String which will allow me to lookup a component / page at a later stage. Is there a component path that will uniquely identify the component page / instance? 6. I *think* that DWR has a HTTPServletRequest and HTTPServletResponse that I *might* be able to get a handle on for the push. Any ideas on how I would lookup the page / component / component resources? Cheers, Lance. -- View this message in context: http://tapestry.1045711.n5.nabble.com/tapestry-push-proof-of-concept-tp5697644.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org