Do you want one chat room per instance (but you get to choose the chat room)
or do you want to have many chat room comet actors?
If it's the former, I'd set up a SessionVar with the current chat room. The
CometActor would access that SessionVar during initialization and choose the
chat room
Try this:
def create(xhtml: Group): NodeSeq = {
def redo(b: Blog)(n: NodeSeq): NodeSeq = table(b.toForm(Full(Create),
redo(b), handleSubmit _))
User.currentUser.map(_.createBlog) match {
case Full(b) = redo(b)(xhtml)
case _ = S.warning(There's no user logged in); NodeSeq.Empty
David
If it's the latter, I'd use the name attribute in lift:comet type=Chat
name=LiftChatRoom/ to pass the information. Lift creates a separate
CometActor instance for each different name. Thus, you can have 5
CometActors for 5 different chat rooms as long as they have a unique name.
Hello,
I'm facing another UTF-8 encoding issue. When I submit text with
accented characters in a text field from the browser, the encoding
gets lost somewhere on its way to the RequestVar. I'm using the code
snippet below that writes back the list of messages submitted. For
example, when I type
Hi:
How can I pass initialization parameter to a Comet Actor?
Using the chat demo as a use case, consider if I want;
- let the user choose a chat room,
- the list of chat room is only known at runtime (I can't pass the room's
id in the xhtml template)
Is it as simple as calling