I am trying create form control which can fetch users from a particular group. From the link, I found that it can be achieved by MultiSelectInput form control. In that widget I am making a call to "api/groups/ALFRESCO_ADMINISTRATORS/children" service API which returns all users of the group.
{
id: "MULTI_SELECT_1",
name: "alfresco/forms/controls/MultiSelectInput",
config: {
label: "My multi-select input",
name: "mySelect",
width: "400px",
choiceCanWrap: false, // Whether chosen items' text can wrap over multiple lines (defaults to true)
choiceMaxWidth: "50%", // The maximum width of chosen items (defaults to 100%)
optionsConfig: {
labelAttribute: "Select", // What's displayed in the dropdown and choice (defaults to label)
queryAttribute: "shortName", // The attribute that's used when filtering the dropdown (defaults to name)
valueAttribute: "displayName", // The actual submitted value for each chosen item (defaults to value)
publishTopic: "ALF_RETRIEVE_MULTISELECT_INFO",
publishPayload: {
uri: "api/groups/ALFRESCO_ADMINISTRATORS/children"
},
labelFormat: { // Optional label format strings (all default to item[this.store.labelAttribute] if not specified)
choice: "shortName",
result: "displayName",
full: "shortName - displayName"
},
searchStartsWith: true // Whether the query attribute should start with the search string (defaults to false)
}
}
}
But I am not able to get any user multiselectinput. It would appreciate if anyone can help me to achieve this.
Solved! Go to Solution.
You can use ALF_GET_FORM_CONTROL_OPTIONS as topic. See below configuration.
{
name: "alfresco/forms/controls/MultiSelectInput",
config: {
label: "Admin users",
name: "people",
width: "360px",
optionsConfig: {
queryAttribute: "shortName",
publishTopic: "ALF_GET_FORM_CONTROL_OPTIONS",
publishPayload: {
url: page.url.context + "/proxy/alfresco/api/groups/ALFRESCO_ADMINISTRATORS/children",
resultsProperty: "options",
itemsAttribute: "data",
labelAttribute: "displayName",
valueAttribute: "shortName"
}
}
}
}
You can use ALF_GET_FORM_CONTROL_OPTIONS as topic. See below configuration.
{
name: "alfresco/forms/controls/MultiSelectInput",
config: {
label: "Admin users",
name: "people",
width: "360px",
optionsConfig: {
queryAttribute: "shortName",
publishTopic: "ALF_GET_FORM_CONTROL_OPTIONS",
publishPayload: {
url: page.url.context + "/proxy/alfresco/api/groups/ALFRESCO_ADMINISTRATORS/children",
resultsProperty: "options",
itemsAttribute: "data",
labelAttribute: "displayName",
valueAttribute: "shortName"
}
}
}
}
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.