Using pickers for XWiki Rendering Macro parameters

Last modified by Clément Desableau on 2023/06/01

The type property of a XWiki.WikiMacroParameterClass object allows to specify into which Java type the parameter value (defined as a String) must be converted to.
Depending of the type provided, a custom picker can be used instead of the default one when editing the macro parameters in the wysiwyg editor.

Here are the types implementing a custom picker:

org.xwiki.model.reference.AttachmentReferenceAttachment picker
java.awt.ColorColor picker
java.util.DateDate picker
org.xwiki.model.reference.DocumentReferencePage picker
org.xwiki.model.reference.EntityReferenceStringCustom picker for entity references
org.xwiki.model.EntityTypeCustom picker for entity types
org.xwiki.user.UserReferenceUser Picker

You can also provide the reference of an existing Java Enum to get a custom select picker with its values. However, note that this approach is only possible for Java macros. If you want enum select pickers for Wiki Macros, you can try the following approach.

You can find the pickers implementation here


Get Connected