Class n.a.LiveFragment(_LiveMixin, rend.Fragment):

Part of nevow.athena View Source View In Hierarchy

Known subclasses: nevow.athena.IntrospectionFragment, nevow.livetrial.runner.TestSuiteFragment, nevow.livetrial.testcase.TestCase, nevow.taglibrary.tabbedPane.TabbedPaneFragment

Base-class for fragments of a LivePage.  When being rendered, a
LiveFragment has a special ID attribute added to its top-level
tag.  This attribute is used to dispatch calls from the client
onto the correct object (this one).

A LiveFragment must use the `liveFragment' renderer somewhere in
its document template.  The node given this renderer will be the
node used to construct a Widget instance in the browser (where it
will be saved as the `node' property on the widget object).

JavaScript handlers for elements inside this node can use
C{Nevow.Athena.Widget.get} to retrieve the widget associated with
this LiveFragment.  For example:

    <form onsubmit="Nevow.Athena.Widget.get(this).callRemote('foo', bar); return false;">

Methods of the JavaScript widget class can also be bound as event
handlers using the handler tag type in the Athena namespace:

    <form xmlns:athena="http://divmod.org/ns/athena/0.7">
        <athena:handler event="onsubmit" handler="doFoo" />
    </form>

This will invoke the C{doFoo} method of the widget which contains the
form node.

Because this mechanism sets up error handling and otherwise reduces the
required boilerplate for handling events, it is preferred and
recommended over directly including JavaScript in the event handler
attribute of a node.

The C{jsClass} attribute of a LiveFragment instance determines the
JavaScript class used to construct its corresponding Widget.  This
appears as the 'athena:class' attribute.

JavaScript modules may import other JavaScript modules by using a
special comment which Athena recognizes:

    // import Module.Name

Different imports must be placed on different lines.  No other
comment style is supported for these directives.  Only one space
character must appear between the string 'import' and the name of
the module to be imported.  No trailing whitespace or
non-whitespace is allowed.  There must be exactly one space
between '//' and 'import'.  There must be no preceeding whitespace
on the line.

C{Nevow.Athena.Widget.callRemote} can be given permission to invoke methods
on L{LiveFragment} instances by passing the functions which implement those
methods to L{nevow.athena.expose} in this way::

    class SomeFragment(LiveFragment):
        def someMethod(self, ...):
            ...
        expose(someMethod)

Only methods exposed in this way will be accessible.

L{LiveFragment.callRemote} can be used to invoke any method of the widget
on the client.

Elements with id attributes will be rewritten so that the id is unique to
that particular instance. The client-side C{Nevow.Athena.Widget.nodeById}
API is provided to locate these later on. For example:

    <div id="foo" />

and then:

    var node = self.nodyById('foo');

On most platforms, this API will be much faster than similar techniques
using C{Nevow.Athena.Widget.nodeByAttribute} etc.

Split Table into Classes Show Methods in One Table

Line # Kind Name Docs
1381 Method __init__ Undocumented

Inherited from Fragment:

Line # Kind Name Docs
384 Method get Return the data
387 Method rend Turn this instance into stan suitable for displaying it in a web page.
432 Method remember Remember an object for an interface on new PageContexts which are
443 Method rememberStuff Undocumented

Inherited from DataFactory (via Fragment):

Line # Kind Name Docs
120 Method child Return a conceptual child; an attribute, or a key,

Inherited from RenderFactory (via Fragment):

Line # Kind Name Docs
60 Method renderer Return a renderer with the given name.

Inherited from MacroFactory (via Fragment):

Line # Kind Name Docs
90 Method macro Return a macro with the given name.

Inherited from ConfigurableMixin (via Fragment):

Line # Kind Name Docs
193 Method getBindingNames Expose bind_* methods and attributes on this class.
200 Method getBinding Massage bind_* methods and attributes into an
223 Method getDefault Get a default value for a given binding. If the
235 Method postForm Accept a form post to the given bindingName.
Line # Kind Name Docs
1381 Method __init__ Undocumented
120 Method child Return a conceptual child; an attribute, or a key,
384 Method get Return the data
200 Method getBinding Massage bind_* methods and attributes into an
193 Method getBindingNames Expose bind_* methods and attributes on this class.
223 Method getDefault Get a default value for a given binding. If the
90 Method macro Return a macro with the given name.
235 Method postForm Accept a form post to the given bindingName.
432 Method remember Remember an object for an interface on new PageContexts which are
443 Method rememberStuff Undocumented
387 Method rend Turn this instance into stan suitable for displaying it in a web page.
60 Method renderer Return a renderer with the given name.
def __init__(self, *a, **kw): (source)
Undocumented
API Documentation for Nevow, generated by pydoctor.