I want to disable the button once clicked in Webchat/Directline channel.
Once a user has clicked on a button, that button should get disabled to prevent duplicate usage of the button.
In case it was missed in the linked GitHub issue, using the method described in the BotFramework-WebChat sample 05.custom.components/l.disable-adaptive-cards will achieve this for you.
In short, you are creating an attachment middleware that filters incoming attachments on their type. Internally, when Web Chat detects you have clicked the adaptive card button the to-be rendered HTML for the adaptive card is then given the disabled tag.
I've tested this many times and it works. It should for you, as well.
Related
I am working on a bot in which I am using a waterfall dialog with some prompts to gather information from the user. The dialog is getting triggered by a button click on an adaptive card.
Now if a user clicks the button, go into the dialog mode, scroll up and clicks the same action button (might be a different action button too), what are the possible options that MS bot service provide to handle such scenarios where:
I can let the user know of the existing dialog mode.
I can pause the flow until the user receives a response for the second requested action item and
continue from where the conversation left off.
Use suggested actions that are hidden after being clicked or use adaptive cards and
the communities adaptive card prompt
My experience with dialog flow is minimal. I want to add clickable button responses that an end-user can select from. I do not want to use any other platform except for Default. I will be implementing this on my website. I have not enabled webhook and fulfillment yet. I just want to write the code to add buttons, test it, and then publish my agent on the website.
I have bad news for you. From the default features the only option you have for implementing it on your website is using Web Demo which does not support rich responses(button, image, etc..). That means if you want to implement a bot with rich response on your website, you will have to enable Fulfillment and use webhook.
Is it possible to display the Stripe Payment Request Button as a Google Pay button? Currently, it shows up as an Apple Pay button on iOS devices. But when I open it from Chrome, it looks like this:
I believe this is intentional on stipes part - showing a button saying "google pay" would not be strictly correct, as chrome lets you pay with cards stored in the browser that are NOT google pay.
This is discussed a bit in more detail here: https://github.com/stripe/stripe-payments-demo/issues/9
However, if you don't care that it's absolutely correct, you can add whatever button you want: https://stripe.com/docs/stripe-js/elements/payment-request-button#html-js-own-button:
Using your own button
If you wish to design your own button instead of using the paymentRequestButton > Element, you may show your custom button based on the result of
paymentRequest.canMakePayment(). Then, use paymentRequest.show() to display the > browser interface when your button is clicked.
So it should be possible to create your own google pay button in whatever style you want (by styling it separately for chrome, which I'm not sure how to do, perhaps you can find help here: How to apply specific CSS rules to Chrome only?). The payment request API does not currently support determining which payment options are availible, so this is a problem you'll have to overcome.
UPDATE
Since April 2021, Stripe now shows you the google pay button by default:
Google Pay UI update: We now show a branded “Google Pay” button instead of the generic “Pay now” button when Google Pay is an option
I have a Slack bot that, in response to a /command - a search query - can display a list of matched database entries. I would like to present this list as a clickable link + short summary for each of the DB entries (using blocks).
Example:
Clicking the link for any entry should tell the Slack bot to display the full database record as a new Slack message.
I can't figure out how to get a link to do anything other than open the browser. None of the options for deep linking, or linking to a bot mention appear to be suitable.
Can anyone think of a solution for this? I would prefer not to give each list entry a button or accessory to 'open' the link.
already tried :
Each item as an https:// link to the node app behind the bot, passing the title to be displayed. This works but opens a browser window in the interim.
Mentioning the bot in a link <#ABOTID>Title to open
You can only deep link to existing messages, but not use links the same way you can use buttons.
You could of course link directly to your app, but that would always also open the browser, which as you say you don't want.
So for blocks you are left with the option you already mentioned: putting a button next to each entry in the form of a Section with a button.
An alternative would be to use Secondary Attachments. Those are automatically collapsed for longer text and the user gets a button he can click to expand them.
I had created a simple web part with one label, and one button. I wnat that when i click the button the label content will change.
But when i debugg i found that the focus is not going inside the Button Click Event function.
When i click the button the debugger will again start with page load.
Is there any Autofocus for Button.
Please help me to resolve my problem.
Thanks :)
I think that you're confused about what happens on the client (within the browser) and what happens on the server (in your ASP.NET code).
Most events on server-side controls, like the ASP.NET button, are handled server-side, through a mechanism called postback. The generated code on the browser causes a form submit to the Web server, where the page and its controls are re-created. The form data is parsed and the button control generates (in your case) a Click event for your server-side code. This code regenerates a new HTML page which will replace the old one.
Fortunately for you in this case, the ASP.NET button has a property "OnClientClick" where you can insert JavaScript code to do whatever you want (like change the label text) directly in the browser.
See MSDN for the docs on the property and an example of using both Click and OnClientClick.
Note that this is not related to SharePoint, this is a pure ASP.NET issue.