【发布时间】:2018-11-09 18:57:46
【问题描述】:
我正在尝试在 BOT DirectLine 聊天中显示自适应卡片。自适应卡将包含表格格式的数据。我想在表格的每一行上添加操作按钮来执行特定的操作。
但我无法在 ColumnSet 中添加“Action.Submit”。我只能在正文部分之外添加(即单独的操作部分)。
请帮助我。下面是发送到 Directline 客户端的示例 JSON。
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "Pending Items",
"weight": "bolder",
"size": "medium"
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Number",
"weight": "bolder",
"wrap": true
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Module",
"weight": "bolder",
"wrap": true
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Pending count",
"weight": "bolder",
"wrap": true
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Action",
"weight": "bolder",
"wrap": true
}
]
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "1",
"weight": "bolder",
"wrap": true
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Module 1",
"weight": "bolder",
"wrap": true
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "1",
"weight": "bolder",
"wrap": true
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "Input.Toggle",
"id": "acceptTerms",
"title": "Select this",
"value": "true",
"valueOn": "true",
"valueOff": "false"
}
]
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "2",
"weight": "bolder",
"wrap": true
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Module 1",
"weight": "bolder",
"wrap": true
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "10",
"weight": "bolder",
"wrap": true
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "Input.Toggle",
"id": "acceptTerms",
"title": "Select this",
"value": "true",
"valueOn": "true",
"valueOff": "false"
}
]
}
]
}
]
}
],
"actions": [
{
"type": "Action.ShowCard",
"title": "Proceed Selected",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "Are you sure want to Proceed",
"weight": "bolder",
"wrap": true
}
],
"actions": [
{
"type": "Action.Submit",
"title": "OK"
}
]
}
},
{
"type": "Action.Submit",
"title": "Cancel",
"id": "c1"
}
]
}
【问题讨论】: