01-29-2017 06:20 AM
I am confused and frustrated - not an unusual state I admit. However my problem is that despite reworking my code for the last week and finding many silly errors (like trying to use OptionService instead of OptionsService) I still can get this dam select box to populate with a list of users.
I have been able to get it to work using the optionsConfig fixed from the documentation example.
Following Dave Drapers video I can see the users from the service but get an empty select box
I am now at the point were I dont know what to do next, probably a stupid error (slight dyslexia so used to that) but if anyone can spot it there a virtual brew in it for you.
The form is in a dashlet as follows:
model.jsonModel = {
rootNodeId: args.htmlid,
pubSubScope: instance.object.id,
bodyHeight: "400px",
services: [
// { name: "alfresco/services/LoggingService",
// config: {
// loggingPreferences:{
// enabled: true,
// all: true
// }
// }
// },
"alfresco/services/OptionsService"
],
widgets: [
// {
// name: "alfresco/logging/DebugLog",
// },
{
name: "alfresco/dashlets/Dashlet",
config: {
title: "My Messages",
bodyHeight: args.height || null,
componentId: instance.object.id,
widgetsForTitleBarActions: [
{
id: "MESSAGING_DASHLET_ACTIONS",
name: "alfresco/html/Label",
config: {
label: "Title-bar actions"
}
}
],
widgetsForToolbar: [
{
id: "MESSAGING_DASHLET_TOOLBAR",
name: "alfresco/html/Label",
config: {
label: "Toolbar"
}
}
],
widgetsForBody: [
{
id: "HELLO_DASHLET_VERTICAL_LAYOUT",
name: "alfresco/layout/VerticalWidgets",
config: {
widgetWidth: "350px",
widgets: [
{ name: "alfresco/forms/Form",
config: {
showOkButton: true,
okButtonLabel: "Send",
showCancelButton: false,
okButtonPublishTopic: "PUBLISH_TOPIC_MESSAGE",
okButtonPublishGlobal: true,
widgets: [{
name: "alfresco/forms/controls/TinyMCE",
config: {
fieldId: "MESSAGE_TEXT",
name: "message",
label: "Message",
widgetWidth: 200
}
},
{
name: "alfresco/forms/controls/Radio",
config: {
fieldId: "RECIPENT",
name: "recipient",
label: "Send to",
optionsConfig: {
publishTopic: "ALF_GET_FORM_CONTROL_OPTIONS",
publishPayload: {
url: url.context + "/proxy/alfresco/api/people",
itemsAttribute: "people",
labelAttribute: "firstName",
valueAttribute: "userName"
}
}
}
}]
}
}
]
}
}
]
}
}
]
};
02-23-2017 05:03 PM
You say you want to fill a select box with options, yet in the JSON model you have used a "alfresco/forms/controls/Radio" widget. If you want a selection box you need either "alfresco/forms/controls/Select", "alfresco/forms/controls/FilteringSelect" or "alfresco/forms/controls/ComboBox" (depending on additional requirements - the Select widget would be the most basic one).
02-27-2017 05:34 AM
I have been trying many options. According to a video I watched should be no difference between select and radio in the way they are populated, both should work from OptionsService.
02-27-2017 05:48 AM
I was primarily pointing out the discrepancy between your text and the JSON model. Can you please link which specific video you are talking about?
In current Aikau I cannot find a widget called alfresco/forms/controls/Radio.There is a alfresco/forms/controls/RadioButtons one and that only supports the static "options" attribute.
Explore our Alfresco products with the links below. Use labels to filter content by product module.