cogThis is a custom suggest displayer for DBList object properties which adapts the suggest feature to multiple selection.
TypeXAR
Developed by

Ludovic Dubost, Marta Girdea, Anca Luca, Raluca Stavro, Paul Pantiru, Mohamed Boussaa

Active Installs25
Rating
Rate!
0 Votes
LicenseGNU Lesser General Public License 2.1
Installable with the Extension Manager

Description

This is a custom suggest displayer for DBList object properties which adapts the suggest feature to multiple selection.

Usage

Please note that this extension will only work for properties which have explicit hibernate queries set. Properties configured using the  XWiki class name, id field name and value field name settings cannot be enhanced using this extension (actually, suggest won't work at all on such properties).

Note: because of a bug in XWiki < 6.4.5, the hibernate query must be tipped with lower case characters only. Eg: "select .. from" instead of "SELECT ... FROM".

To activate it, you must edit the XClass and set, for the target property, the fields Use suggest and Multiple select to true, Display Type to input and the field Custom display to:

{{include document="XWiki.SuggestDisplay" /}}

I the Custom display you can also add a few options:

{{velocity}}
  #set($isUser = true)
  #set($isLink = true)
  #set($isExternalLink = true)
  #set($displayAddButton = true)
{{/velocity}}
 The autosuggest widget will not work if Main.WebHome is not saved with programming rights ( https://jira.xwiki.org/browse/XE-539

Edit items

Since the version 1.3, it is now possible to edit the items selected, or to create new ones.

To enable this feature, you need to set the following variable in the custom displayer:

#set($SuggestDisplayItemsEditable = true)

To force the space where the new items will be created:

#set($SuggestDisplayEditModeSpace = "yourSpace")

Screenshots

customDisplay.png

With the options to edit items:

suggest-with-editable-mode.png

Tested on

This extension has been tested with the following configurations.

Extension VersionXWiki FlavorNotes
1.0XWiki Enterprise 6.0.1
1.0XWiki Enterprise 2.7.1

And earlier XE versions with some limitations.

1.1XWiki Enterprise 6.2.2
1.1XWiki Enterprise 5.2.x
1.2XWiki Enterprise 6.2.2
1.2XWiki Enterprise 5.2.x

Prerequisites & 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:

  1. Log in the wiki with a user having Administration rights
  2. Go to the Administration page and select the Import category
  3. Follow the on-screen instructions to upload the downloaded XAR
  4. Click on the uploaded XAR and follow the instructions
  5. You'll also need to install all dependent Extensions that are not already installed in your wiki

After importing the XAR, the document XWiki.SuggestDisplay is created and can be used as described above.

Release Notes

v1.5

  • Task Closed MSD-12 When adding a new element and then uploading & selecting an image, the fieled values is lost from the form
  • Bug Closed MSD-11 XML entities are displayed in view mode
  • Improvement Closed MSD-9 Change the confirmation box when removing the image of an item
  • Bug Closed MSD-1 The save/cancel buttons are lost after uploading an image on the create entry form

v1.4

  • Bug Closed MSD-8 "Add new entry" link not displayed

v1.3

  • New Feature Closed MSD-6 First version of the itemsEditable mode

v1.2

Added support for upgrade from earlier versions, with Extension Manager

v1.1

New version with:
*Compatibility with 5.2 +
*Added options for add button, $isLink, $isExternalLink and $isUser
*Added drag & drop functionality for reordering values
*Fixed conflict with single select with suggest
*Fixed bug with values containing comma
Issue:
*version 1.0 cannot be simply upgraded to 1.1 via Extension Manager (the old version has to be removed and the new one installed)

v1.0

Initial version

Dependencies

Dependencies for this extension (org.xwiki.contrib:displayer-multiselect-suggest 1.6):

  • org.webjars:jquery-form 3.51
Created by Marta Girdea on 2011/03/05 16:21
    

Get Connected