I wrote my first comet actor today. Pretty neat stuff, and it was less difficult and painful than I expected. :) I'm having a bit of an issue figuring out how to render exactly what I want, though.

My comet actor tracks a series of data imports, and since the import statuses change pretty rapidly, it makes more sense to poll at regular intervals and redraw the entire table of imports or perhaps the individual row than it does to do something more complex--at least for now. What I want to do, though, is display the table but only if there are imports active. If there are none, just display a paragraph stating that none are currently in progress.

My issue is that since import statuses are displayed in a table, and since there may be two or three, I seem to either be able to display an empty table or nothing at all. Here's my template:

<lift:surround with="default" at="content">
<table>
<tr>
<th>Name</th><th>Complete</th><th>Total</th><th>Status</th>
</tr>
<lift:comet type="ImportMonitor">
<tr>
<td><import:name/></td>
<td><import:complete/></td>
<td><import:total/></td>
<td><import:status/></td>
</tr>
</lift:comet>
</table>
</lift:surround>

If I try putting the table into another template and having ImportMonitor return <lift:embed>, I seem to get nothing. If I move the <table> into the <lift:comet>, I get an entire table for each individual import.

The only thing that occurs to me is to define the <table> in the code of my render method. Is this my only option? Or am I missing something obvious?

Also, how are comet actors timed out? I notice that if I kill the Firefox tab, I still get my printlns from the actor on my console, and I don't see the debugging code around my unsubscription mechanism triggered. Should I be doing something else to get localShutdown triggering, or does that happen when the sessions are cleaned up? If shutdown methods are only run on session expiration, is there any other way to tell a master publishing actor that it doesn't have to do any work on the behalf of a listener that no longer pays attention?

Thanks.


--
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

Reply via email to