CometListener

This trait adds functionality to automatically register with a given
Actor using AddAListener and RemoveAListener control messages. The most
typical usage would be to register with an instance of ListenerManager.
You will need to provide a def/val for the

registerWith

member
to control which Actor to connect to.

See ListenerManager for a complete example.

registerWith
to control which Actor to connect to.
See ListenerManager for a complete example.

It's the main method to override, to define what is rendered by the CometActor

It's the main method to override, to define what is rendered by the CometActor

There are implicit conversions for a bunch of stuff to
RenderOut (including NodeSeq). Thus, if you don't declare the return
turn to be something other than RenderOut and return something that's
coercible into RenderOut, the compiler "does the right thing"(tm) for you.
There are implicit conversions for NodeSeq, so you can return a pile of
XML right here. There's an implicit conversion for NodeSeq => NodeSeq,
so you can return a function (e.g., a CssBindFunc) that will convert
the defaultHtml to the correct output. There's an implicit conversion
from JsCmd, so you can return a pile of JavaScript that'll be shipped
to the browser.
Note that the render method will be called each time a new browser tab
is opened to the comet component or the comet component is otherwise
accessed during a full page load (this is true if a partialUpdate
has occurred.) You may want to look at the fixedRender method which is
only called once and sets up a stable rendering state.

Convert a Seq[Node] (the superclass of NodeSeq) to a RenderOut.
The render method
returns a RenderOut. This method implicitly (in Scala) or explicitly
(in Java) will convert a NodeSeq to a RenderOut. This
is helpful if you return a NodeSeq from your render method.

defbuildSpan(time: Long, xml: NodeSeq): NodeSeq

defcacheFixedRender: Boolean

By default, we do not cache the value of fixedRender.

By default, we do not cache the value of fixedRender. If it's
expensive to recompute it each time there's a conversion
of something to a RenderOut, override this method if you
want to cache fixedRender.

Comet Actors live outside the HTTP request/response cycle.
However, it may be useful to know what Request led to the
creation of the CometActor. You can override this method
and capture the initial Req object. Note that keeping a reference
to the Req may lead to memory retention issues if the Req contains
large message bodies, etc. It's optimal to capture the path
or capture any request parameters that you care about rather
the keeping the whole Req reference.

Finds and returns one of many templates from the children based
upon the namespace and tag name: for example, for prefix "choose"
and tag name "stuff" this would return the contents of the
first tag <choose:stuff> ... </choose:stuff>
in the specified NodeSeq.

Finds and returns one of many templates from the children based
upon the namespace and tag name: for example, for prefix "choose"
and tag name "stuff" this would return the contents of the
first tag <choose:stuff> ... </choose:stuff>
in the specified NodeSeq.

defclearWiringDependencies(): Unit

Clear the common dependencies for Wiring.

Clear the common dependencies for Wiring. This
method will clearPostPageJavaScriptForThisPage() and
unregisterFromAllDependencies(). The combination
will result in a clean slate for Wiring during a redraw.
You can change the behavior of the wiring dependency management
by overriding this method

defcomposeFunction: PartialFunction[Any, Unit]

Compose the Message Handler function.

Compose the Message Handler function. By default,
composes highPriority orElse mediumPriority orElse internalHandler orElse
lowPriority orElse internalHandler. But you can change how
the handler works if doing stuff in highPriority, mediumPriority and
lowPriority is not enough.

deferror(n: String): Unit

By default, CometActor handles RedirectShortcutException, which is
used to handle many types of redirects in Lift.

By default, CometActor handles RedirectShortcutException, which is
used to handle many types of redirects in Lift. If you override this
PartialFunction to do your own exception handling and want redirects
from e.g. S.redirectTo to continue working correctly, make sure you
chain back to this implementation.

Find the first Elem in the NodeSeq. If it has an id attribute,
then call the function, f, with that id. If the first Elem
does not have an id attribute, create an id attribute and
pass that id attribute to the function

A part of the CometActor's screen real estate that is not
updated by default with reRender().

A part of the CometActor's screen real estate that is not
updated by default with reRender(). This block of HTML is
useful for the editor part of a Comet-based control where
the data is JSON and updated with partialUpdates.

The lifespan of this component. By default CometActors
will last for the entire session that they were created in,
even if the CometActor is not currently visible. You can
set the lifespan of the CometActor. If the CometActor
isn't visible on any page for some period after its lifespan
the CometActor will be shut down.

deflistenerTransition(): Unit

This method will be called when there's a change in the long poll
listeners.

This method will be called when there's a change in the long poll
listeners. The method does nothing, but allows you to get a granular
sense of how many browsers care about this CometActor. Note that
this method should not block for any material time and if there's
any processing to do, use Scheduler.schedule or send a message to this
CometActor. Do not change the Actor's state from this method.

deflowPriority: PartialFunction[Any, Unit]

defmanualWiringDependencyManagement: Boolean

By default, Lift deals with managing wiring dependencies.

By default, Lift deals with managing wiring dependencies.
This means on each full render (a full render will
happen on reRender() or on a page load if there have been
partial updates.) You may want to manually deal with
wiring dependencies. If you do, override this method
and return true

final defnotify(): Unit

final defnotifyAll(): Unit

Convert a NodeSeq => NodeSeq to a RenderOut. The render method
returns a RenderOut. This method implicitly (in Scala) or explicitly
(in Java) will convert a NodeSeq => NodeSeq to a RenderOut. This
is helpful if you use Lift's CSS Selector Transforms to define
rendering.

implicit defpairToPair(in: (String, Any)): (String, NodeSeq)

defparentTag: Elem

Perform a partial update of the comet component based
on the JsCmd. This means that the JsCmd will be sent to
all of the currently listening browser tabs. This is the
preferred method over reRender to update the component

defpoke(): Unit

Poke the CometActor and cause it to do a partial update Noop which
will have the effect of causing the component to redisplay any
Wiring elements on the component.

Poke the CometActor and cause it to do a partial update Noop which
will have the effect of causing the component to redisplay any
Wiring elements on the component.
This method is Actor-safe and may be called from any thread, not
just the Actor's message handler thread.

defreRender(): Unit

Cause the entire component to be reRendered and pushed out
to any listeners.

Cause the entire component to be reRendered and pushed out
to any listeners. This method will cause the entire component
to be rendered which can result in a huge blob of JavaScript to
be sent to the client. It's a much better practice to use
partialUpdate for non-trivial CometActor components.

defreRender(sendAll: Boolean): Unit

Cause the entire component to be reRendered and pushed out
to any listeners.

Cause the entire component to be reRendered and pushed out
to any listeners. This method will cause the entire component
to be rendered which can result in a huge blob of JavaScript to
be sent to the client. It's a much better practice to use
partialUpdate for non-trivial CometActor components.

Override this method to deal with JSON sent from the browser via the sendJson function.

Override this method to deal with JSON sent from the browser via the sendJson function. This
is based on the Lift JSON package rather than the handleJson stuff based on the older util.JsonParser. This
is the preferred mechanism. If you use the jsonSend call, you will get a JObject(JField("command", cmd), JField("param", params))

defsendInitialReq_?: Boolean

Is this CometActor going to capture the initial Req
object? If yes, override this method and return true
and override captureInitialReq to capture the Req.

Is this CometActor going to capture the initial Req
object? If yes, override this method and return true
and override captureInitialReq to capture the Req. Why
have to explicitly ask for the Req? In order to send Req
instances across threads, the Req objects must be snapshotted
which is the process of reading the POST or PUT body from the
HTTP request stream. We don't want to do this unless we
have to, so by default the Req is not snapshotted/sent. But
if you want it, you can have it.

defshouldUpdate: PartialFunction[Any, Boolean]

Override this in order to selectively update listeners based on the given message.

Override this in order to selectively update listeners based on the given message.
This method has been deprecated because it's executed in a separate context from
the session's context. This causes problems. Accept/reject logic should be done
in the partial function that handles the message.

Attributes

protected

Annotations

@deprecated

Deprecated

(Since version 2.4) Accept/reject logic should be done in the partial function that handles the message.