XWiki Livetable Checkbox Column Macro
| Adds the option to select the rows of a livetable by inserting a new column with checkboxes in the table. |
| Type | XAR |
| Category | Macro |
| Developed by | |
| Active Installs | 31 |
| Rating | |
| License | GNU Lesser General Public License 2.1 |
Table of contents
Description
This macro is adding a new column in the livetable containing checkboxes for selecting table rows. It supports the following parameters :
| Name | Description | Is Mandatory | Since | Default value |
|---|---|---|---|---|
| livetable | The id of the livetable | Yes | 1.0 | N/A |
| column | The target column to use the values of when selecting items in the checkbox column | Yes | 1.0 | N/A |
| serviceDocument | The name of the document acting as service for the selected values | No | 1.0 | N/A |
| buttonId | The id of the element that is clicked for sending data to the service document | No | 1.0 | N/A |
| title | The title of the column that will have the checkboxes | No | 1.1.0 | N/A |
| urlParams | The default URL parameters that will be sent to the server | No | 1.1.0 | xpage=plain&outputSyntax=plain |
Since 1.1.0, after the call to the service document, a JavaScript event is fired in the document. The name of the event is :
- xwiki:livetable:${livetableId}:checkboxes:success if the call was sucessful (HTTP 200)
- xwiki:livetable:${livetableId}:checkboxes:failure if the call failed
Example of usage
The code
{{html}}
<div class="buttonwrapper">
<a href="" id="checkboxService" class="button">Send checkbox data</a>
</div>
{{/html}}
{{velocity}}
#set($columns = ['doc.fullName', 'doc.title', 'doc.author', 'doc.date'])
#set($columnsProperties = {
'doc.fullName' : { 'type' : 'hidden' },
'doc.title' : { 'displayName' : 'Title' } ,
'doc.author' : { 'displayName' : 'Author' } ,
'doc.date' : { 'displayName' : 'Date' }
})
#set($options = {
'extraParams':'&space=XWiki',
'queryFilters': '&hidden=true'
})
#livetable('myLivetable' $columns $columnsProperties $options)
{{/velocity}}
{{addCheckboxColumnToLivetable livetable="myLivetable" column="doc.fullName" buttonId="checkboxService" serviceDocument="Code.ServiceDocument" /}}The result
1. The livetable
Selecting multiple values of the doc.fullName colum that is hidden in this example :

2. Sending data to the service document
The URL of the Ajax request sent by the macro :
http://localhost:8080/xwiki/bin/Code/ServiceDocument?outputSyntax=plain&xpage=plain&cbData=docsmanagement%3AXWiki.AdminEditingSheet&cbData=docsmanagement%3AXWiki.AdminElementsSheet&cbData=docsmanagement%3AXWiki.AdminGroupsSheet&cbData=docsmanagement%3AXWiki.AccountValidation&cbData=docsmanagement%3AXWiki.AdminExportSheetPrerequisites & Installation Instructions
We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.
You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:
- Log in the wiki with a user having Administration rights
- Go to the Administration page and select the Import category
- Follow the on-screen instructions to upload the downloaded XAR
- Click on the uploaded XAR and follow the instructions
- You'll also need to install all dependent Extensions that are not already installed in your wiki