user833970
user833970

Reputation: 2799

In Lift, how do you bind to instances instead of classes for comet?

This may be a it of a beginner question, in the simply lift tutorial it shows how to bind to a class type with xml like:

<div class="lift:comet?type=Chat"> 
...
</div>

or

<lift:comet type="Chat">
...
</lift:comet>

But what if you want the user to see multiple different chat streams on the same page? Ideally this would happen with multiple instantiations of the Chat class. Is there some way to bind to specific objects? Or at least to parametrize the binding so multiple instances could be used behind the scenes?

Upvotes: 2

Views: 80

Answers (1)

Dylan
Dylan

Reputation: 13859

This blog post should prove helpful.

The gist of it is that you get a different Comet actor depending on the name you specify. You just have to have some wiring behind the scenes that registers the actors to some "master" on a per-name basis.

Upvotes: 1

Related Questions