Alfresco dashlet查询中的表单
一个多星期以来,我一直在试图在奥凯dashlet中获得一份表格。让它出现在仪表板上确实很容易,但我所做的任何事情都没有导致将其发送到服务器 是否有人或知道有人的表单完全在Dashlet中工作 我的不会从选项中阅读服务不会在提交时填写选择或发布到任何主题的下拉列表,只是坐在那里什么也不做。我可以在调试窗口中看到事件,但在chrome和firefox调试视图中没有网络活动,服务器什么也不做 dashlet获取jsAlfresco dashlet查询中的表单,alfresco,alfresco-share,alfresco-webscripts,Alfresco,Alfresco Share,Alfresco Webscripts,一个多星期以来,我一直在试图在奥凯dashlet中获得一份表格。让它出现在仪表板上确实很容易,但我所做的任何事情都没有导致将其发送到服务器 是否有人或知道有人的表单完全在Dashlet中工作 我的不会从选项中阅读服务不会在提交时填写选择或发布到任何主题的下拉列表,只是坐在那里什么也不做。我可以在调试窗口中看到事件,但在chrome和firefox调试视图中没有网络活动,服务器什么也不做 dashlet获取js model.jsonModel = { rootNodeId: args.ht
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/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/Select",
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"
}
}
}
}]
}
}
]
}
},
{
name: "alfresco/logging/DebugLog",
}
]
}
}
]
};
dashlet获取html ftl
<@markup id="widgets">
<@processJsonModel group="share-dashlets" rootModule="alfresco/core/Page"/>
</@>
<@markup id="html">
<div id="${args.htmlid?html}"></div>
</@>
dashlet获取描述xml
<webscript>
<shortname>Dashlet</shortname>
<description>An Aikau dashlet</description>
<family>dashlet</family>
<url>/dashlets/messaging</url>
</webscript>
我稍微修改了您的代码以获取用户并显示下拉列表。 让我尝试使用选项服务,并将向您更新。 创建了一个新函数getUserList并调用/api/people来获取数据并显示在下拉列表中 希望这对你有帮助
请包含说明您的问题的。已编辑以包含dashlet的当前状态。我看不到您的错误。你能提供更多的信息吗?
model.jsonModel = {
rootNodeId: args.htmlid,
pubSubScope: instance.object.id,
bodyHeight: "400px",
services: [
{ name: "alfresco/services/LoggingService",
config: {
loggingPreferences:{
enabled: false,
all: true
}
}
},
"alfresco/services/OptionsService"
],
widgets: [
{
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/Select",
config: {
fieldId: "RECIPENT",
name: "recipient",
label: "Send to",
optionsConfig: {
fixed: getUsersList()
},
requirementConfig: {
initialValue: true
}
}
}
]
}
}
]
}
},
{
name: "alfresco/logging/DebugLog",
}
]
}
}
]
};
function getUsersList() {
try {
var result = remote.call("/api/people?sortBy=fullName&dir=asc");
var userList = [];
if (result.status == status.STATUS_OK) {
var rawData = JSON.parse(result);
if (rawData && rawData.people) {
var dummyPerson = {
label: "Select Recipient",
value: " ",
selected: true
};
userList.push(dummyPerson);
for (var x = 0; x < rawData.people.length; x++) {
var item = rawData.people[x];
if (item.firstName != null && item.firstName != "" && item.userName.indexOf("@") == -1 && item.enabled == true) {
var displayName = item.firstName + " " + item.lastName;
var person = {
label: displayName,
value: item.userName
};
userList.push(person);
}
}
}
} else {
throw new Error("Unable to fetch User List " + result.status);
}
return userList;
} catch(err) {
throw new Error(err);
}
}