Hi,
Is it possible (in Confluence) to create a dropdown menu or anything similar (e.g. user picker) in a input text field of a velocity template? If yes is there any documentation about it?
Cheers.
Community moderators have prevented the ability to post new answers.
Take a look at
\atlassian-confluence-4.3.7\confluence\includes\js\components\binders\autocomplete-content.js
Unfortunately there is no function implemented to autocomplete users only, but you can edit the file and just add
Confluence.Binder.autocompleteUserinfo = function(scope) { scope = scope || document.body; $("input.autocomplete-userinfo", scope).each(function() { mybind(this, "userinfo", "{title}", contentDisplayHandler); }); };
In addition you need this markup in your velocity template:
<div class="userinfo-binder"> <input type="text" class="autocomplete-userinfo" id="foo" name="bar" data-max="10" data-none-message="No results" data-template="{title}" /> </div>
and you need to bind your new function:
AJS.toInit(function() { Confluence.Binder.autocompleteUserinfo(AJS.$(".userinfo-binder")); });
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.