BotFramework Adaptive Cards - Container Actions are not Rendered -
how can add actions containers? according documentation container type has "actions" object, when testing card in adaptive cards visualizer or in bot-framework emulator no button displayed. attached example kind of card i'm trying generate.
thanks help.
{ "type": "adaptivecard", "body": [ { "style":"normal", "type": "container", "separation" : "strong", "actions": [ { "type": "action.openurl", "url": "http://foo.bar.com", "title": "adaptivecards1" } ], "items": [ { "type": "columnset", "separation": "strong", "columns": [ { "type": "column", "size":1, "items": [ { "type": "textblock", "text": "title", "size": "large", "issubtle": true }, { "type": "textblock", "text": "model: abc", "size": "small" } ] }, { "type": "column", "size": "1", "items": [ { "type": "textblock", "text": " " }, { "type": "image", "url": "https://path/to/image.jpg", "size": "large", "horizontalalignment" :"right" } ] } ] } ] }, { "style":"normal", "type": "container", "separation" : "strong", "actions": [ { "type": "action. openurl", "url": "http://foo.bar.com", "title": "adaptivecards2" } ], "items": [ { "type": "columnset", "separation": "strong", "columns": [ { "type": "column", "size":1, "items": [ { "type": "textblock", "text": "another title", "size": "large", "issubtle": true }, { "type": "textblock", "text": "model: xyz", "size": "small" } ] }, { "type": "column", "size": "1", "items": [ { "type": "textblock", "text": " " }, { "type": "image", "url": "https://path/to/other/image.jpg", "size": "large", "horizontalalignment" :"right" } ] } ] } ] } ]}
per github issue, seems there error in documentation , actions
property doesn't exist on container
.
instead, should add item of type actionset
items
array, list of actions
.
following sample, should like:
{ "type": "adaptivecard", "body": [ { "style": "normal", "type": "container", "separation": "strong", "items": [ { "type": "actionset", "actions": [ { "type": "action.openurl", "url": "http://foo.bar.com", "title": "adaptivecards1" } ] }, { "type": "columnset", "separation": "strong", "columns": [ { "type": "column", "size": 1, "items": [ { "type": "textblock", "text": "title", "size": "large", "issubtle": true }, { "type": "textblock", "text": "model: abc", "size": "small" } ] }, { "type": "column", "size": "1", "items": [ { "type": "textblock", "text": " " }, { "type": "image", "url": "https://path/to/image.jpg", "size": "large", "horizontalalignment": "right" } ] } ] } ] }, { "style": "normal", "type": "container", "separation": "strong", "items": [ { "type": "actionset", "actions": [ { "type": "action.openurl", "url": "http://foo.bar.com", "title": "adaptivecards2" } ] }, { "type": "columnset", "separation": "strong", "columns": [ { "type": "column", "size": 1, "items": [ { "type": "textblock", "text": "another title", "size": "large", "issubtle": true }, { "type": "textblock", "text": "model: xyz", "size": "small" } ] }, { "type": "column", "size": "1", "items": [ { "type": "textblock", "text": " " }, { "type": "image", "url": "https://path/to/other/image.jpg", "size": "large", "horizontalalignment": "right" } ] } ] } ] } ] }
this discussed here.
Comments
Post a Comment