Live Table component

Version 27.1 by fkorteby on 2009/08/11
Warning: For security reasons, the document is displayed in restricted mode as it is not the current version. There may be differences and errors due to this.

Live Table component

Warning

This section documents a feature that is only available starting with XWiki Enterprise 1.9M2.

Invalid macro parameters used for the [toc] macro. Cause: [Failed to validate bean: [must be greater than or equal to 1]]. Click on this message for details.

Summary

The "Live Table" component is a dynamic table loading data lazily using ajax requests as the user browse the table, in order to scale easily the display of very large amounts of data. Users can browse the table thanks to a pagination system. Filters on columns are available to search for specific entries. Columns can be made sortable in both direction. The video below demonstrate the main capabilities of the live table component:

<object width="640" height="401"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=4474332&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=4474332&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="640" height="401"></embed></object>

How to use

The Live Table component is made available in several ways to Applications developers and developers of the XWiki platform and products, depending on their specific needs. The simplest, and most of the times preferred, way to embed a Live Table component is to use the livetable velocity macro, available in all pages of your wiki. With only one call to this macro, you will be able to display a live table of the data of your choice! For more specific needs, in the cases you need more control on the table behavior, or to build another component on top of the live table, it is possible to instantiate the live table from JavaScript. In this case, you, as opposed to the velocity macro, you will need to construct the HTML elements the JavaScript component expects yourself, either from JavaScript, either writing the HTML directly in your wiki page

Using the Velocity livetable macro

One velocity macro call is enough to display a live table of wiki data. The most common use case is displaying a table of documents that contains an XWiki Object of a certain class. This is a powerful way for in-wiki applications developers to offer a mining interface on their application data (for example Contacts in a CRM/Contact manager, Bills in a Billing application, etc.). Since Users in XWiki are managed and stored using the Class and Object abstraction of XWiki Data Model, we will illustrate usages of the livetable velocity macro to create a dynamic user directory.

The signature of the macro is the following :

#macro(livetable $id $columns $columnsProperties $options)

Each parameter allows to control the output generated by the macro. Namely:

Failed to execute the [velocity] macro. Cause: [The execution of the [velocity] script macro is not allowed in [xwiki:Documentation.DevGuide.FrontendResources.LiveTable.WebHome]. Check the rights of its last author or the parameters if it's rendered from another script.]. Click on this message for details.

Get Connected