Changes for page Suggest Widget

Last modified by Marius Dumitru Florea on 2022/04/19

<
From version < 57.7 >
edited by Vincent Massol
on 2018/10/23
To version < 58.1 >
edited by Adel Atallah
on 2018/10/23
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.VincentMassol
1 +XWiki.atallahade
Content
... ... @@ -22,7 +22,7 @@
22 22  
23 23  Use information from a predefined class in your wiki (e.g. ##XWiki.TagClass##, ##XWiki.XWikiUsers##, etc.) or from a class defined by yourself.
24 24  
25 -For example, use **XWiki.TagClass** to suggest tags from the wiki tag cloud:
25 +For example, use **XWiki.TagClass** to suggest tags from the wiki tag cloud:
26 26  
27 27  [[image:Documentation.DevGuide.FrontendResources.AutoSuggestWidget.WebHome@suggest.png]]
28 28  
... ... @@ -43,7 +43,7 @@
43 43   Event.observe($('myinput'), "focus", function() {
44 44   new XWiki.widgets.Suggest(this, {
45 45   script: '$xwiki.getURL("${doc.space}.WebHome", "view")?xpage=suggest&classname=XWiki.TagClass&fieldname=tags&secCol=-&',
46 - varname: "input",
46 + varname: "input",
47 47   seps: " ,|",
48 48   offsety: 13
49 49   });
... ... @@ -70,7 +70,7 @@
70 70  
71 71  When the information you want to suggest is not available through a class field or you generate it using a custom query, you need to create a service (plain wiki page called with the ##get## action and with ##outputSyntax=plain## parameter in the url, for example: ##xwiki/bin/get/Space/Page?outputSyntax=plain##) that maps your results to the **xml** input accepted by the widget. For example, you can build a list of suggestions that contains the wiki page names within a certain space:
72 72  
73 -[[image:[email protected]]]
73 +[[image:Documentation.DevGuide.FrontendResources.AutoSuggestWidget.WebHome@customsuggest.png]]
74 74  
75 75  {{code}}
76 76  $!xwiki.jsx.use("DevGuide.AjaxSuggestCustomExample")
... ... @@ -193,7 +193,7 @@
193 193   Event.observe($('userInput'), "focus", function() {
194 194   new XWiki.widgets.Suggest(this, {
195 195   script: '$xwiki.getURL("${doc.fullName}", "view")?xpage=uorgsuggest&classname=XWiki.XWikiUsers&wiki=global&uorg=user&',
196 - varname: "input",
196 + varname: "input",
197 197   seps: " ,|",
198 198   delay : 200,
199 199   timeout: 5000,
... ... @@ -264,6 +264,23 @@
264 264  Since 6.2: there is also the ##auto## value, that will place the search box from the left of the input box unless there is not enough place to display it entirely, otherwise it will be displayed from the right.|##right##
265 265  |##propagateEventKeyCodes##|A sublist of key codes, from the list of keys handled by this widget, for which to propagate the keyboard event. Useful when another keyboard event listener exists on the input field, even if it may be registered at a difference level. See the ##onKeyPress## in the code for a clearer picture.|Empty list. By default, none of the handled key events propagate. All other, not handled, events do.
266 266  
267 += Velocity macros =
268 +
269 +You can use velocity macros to insert the suggest widgets.
270 +
271 +== Page picker widget ==
272 +
273 +The page picker widget can be inserted on a page using the following code:
274 +{{code}}{{velocity}}
275 +{{html}}
276 + #pagePicker()
277 +{{/html}}
278 +{{/velocity}}{{/code}}
279 +
280 +You can specify the HTML attributes of the select by doing this:
281 +{{code}}#set ($parameters = {'multiple': 'multiple', 'id': 'my-id'})
282 +#pagePicker($parameters){{/code}}
283 +
267 267  = Tips =
268 268  
269 269  * Suggest event:(((

Get Connected