How to handle null user inputs within adaptive cards only - c#

How can I show a user a red color message inside the adaptive card itself, when the user tries to hit the ok button without providing any input in the drop-down present in my adaptive cards. I don't want my Luis agent to handle it I want my UI to handle the above scenario

Adaptive Cards don't currently support client-side validation as per this answer from a MSFT employee. You will have to handle this scenario in your code that processes the user input. If the input is not valid, then you could send a message to the user saying please fill in the required fields X, Y, and Z, followed by the original Adaptive Card.
Edit - Additional sources
See this comment from a month ago about validation coming in Version 1.3, along with this issue which is tracking the current status of the input validation functionality.

Related

c# custom credential provider

I am trying to develop a custom credential provider. Trying to learn the basics. I implemented ICredentialProvider and ICredentialProviderCredential.
I added a custom credential tile, edit text and command link to windows logon UI.
What i want to do is, when i click on CommandButton i try to read textbox value but i could not do that.
I want to open a custom windows form (e.g MFA form), how can i open a custom form?
I am using phaetto/windows-credentials-provider implementation as example
There is not much information about this topic.
1. Text field
You must collect and keep securely the value(s) of text box(ex) field(s) as far as it is updated and your tile implementation class is notified about the change of that value.
You will be notified about every single character user entered into the text field. Be ready for this.
As far as user type info input text box your provider's method ICredentialProviderCredential::SetStringValue will be called on every text box update.
2. Popup window (dialog)
If you want to open any window you must acquire a parent window handle from Logon UI / Cred UI. Handle acquisition method is ICredentialProviderCredentialEvents::OnCreatingWindow.
You can find more details in the answer and it's comments: https://stackoverflow.com/a/52089207/3868464 .

Action.Submit validation #bot frameworkV4

My bot consists of adaptive card which has text box and submit.action,when user clicks on submit it does some action in the next dialog
Iam able to prompt the adaptive card and submit the action .
But i need 2things to be done here
1.for few cards when user go back and resubmit the form it has to submit with old data
2.when user go back and click submit it has to throw some prompt message saying card expired or submitted already
I an working with .net core,v4 and waterfall dialog
Can anyone help me in this.
There isn't an easy way to do this in the current state of the Bot Framework. Here's a couple of good options:
Use the AdaptiveCardPrompt. This isn't officially-supported, but I believe provides you with all of the customization you're looking for, out-of-the-box.
Attach your Adaptive Card to an ActivityPrompt and write a custom validator for it.
The trickiest part about your issue is collecting data from a card after the user has already completed the prompt. Once the prompt is over, there's no good way to use it. However, you could:
Add a card Id to the data property of the Action.Submit
Capture the input in OnMessageAsync()
If Activity.Value contains the card Id from step 1, handle it appropriately. Note, however, that it gets very difficult to use this within a dialog if the prompt has already completed.
You can go through the following link for handling user action https://learn.microsoft.com/en-us/azure/bot-service/nodejs/bot-builder-nodejs-dialog-actions?view=azure-bot-service-3.0

Get new Messagebox style - WPF

I am currently working on a Windows Presentation Foundation app and I need to make use of Message boxes. I want to get few information from user inside Message Box popup.
But they appear always like this:
But I think the actual look of it should be like that:
Does anybody know, why this is, and how to solve it? I tried all everything listed
here
, but nothing worked.
I agree with Keithernet, build your own. Its more of an Input Dialog box. You may want to plan it to create a window, create it with ex: 4 parameters which you could override so you can apply them in the form including
The title,
The prompt you want the user to fill in
optional default button 1 text
optional default button 2 text.
have the input value stored into a public property in the window for the text to be bound to during entry.
If the user clicks the cancel button (or similar), clear the text entry and close the window. If ok button, just close the window.
Then, when you call it with a YourWindow.ShowDialog(), upon return, you can look at the public property for that input text value.
You could even do with a property / flag if the user cancelled directly or not. I have done similar in a couple of my WPF apps.
MessageBox is very limited. Based on your screenshot, you should just create your own child Window with your own XAML so you can get the user input.
You can find sample service implementations/NuGets for this on GitHub. Here is one I've created sometime ago: https://github.com/Dirkster99/MsgBox
Just create your own is an oversimplifying statement in my opinion because this is usually a dialog that you want to show in different parts of the application. Therefore, you have to settle for a software design pattern (I chose a service implementation as suggested here).
Likewise, there are other design decisions that should be taken. I have for instance made sure that the API has a compatible subset of Show API calls with the standard .Net MessageBox to make its application as flexible as possible. I also settled for light and dark themes hoping this will make its application easy in any other theme...

Allow (De)Activating only for users with specified field security profile

I'm looking for the best way to forbit (de)activating a record for users that do not have a specified field security profile.
My approach was to display/hide activate/deactivate button depending on the users profiles. And add a synchronous plug-in that checks security profiles when (de)activating a record.
Is there a simpler way? With this approach I have to edit 6 button commands (hompage grid, form, subgrid - activate and deactivate button) and I have to create a new plug-in.
It looks like you have covered all the bases. The most fail safe way would be with a plugin that runs pre operation and checks the security role. From a user point of view it would return an error which might scare them. By hiding the buttons you remove that problem but have to be careful to make sure you remove them from all places you can deactivate a record.
I would say to do both if you want to be sure.

CF UI design - How best to display validation failures

I am thinking of using a messagebox to display validation failure messages in the windows mobile app. that I am currently working on. My thinking here is that there is such limited screen realestate that I'd struggle to dedicate an area on the main form specifically for displaying these validation failures. I am a little concerned as to the usability aspect as the user will be force to close the validation messagebox after a validation failure.
Does anyone have any thoughts on this approach or experience that would suggest that there is a better way of doing this?
I know the ErrorProvider is not available within the compact framework. But maybe this would be a starting point on how to do it.
Like the ErrorProvider i would show a simple icon next to the input box that shows something is wrong. Due to the fact, that you don't have a mouse cursor to hover over it, i would in case of clicking on that icon show a concrete error message in a text box docked at the bottom that will hide again if you simply click it.
So the user gets a hint that something is wrong (maybe he already knows what) and can hit on the icon to get a clue. While the clue is showing he can still insert something within the form (he can't see everything, but currently he is only interested in this single box) and one click further (on the appeared text box) he gets back to full screen.
At a last step the box should maybe also automatically disappear if the focus is changed to another input box or the error is fixed.
I would show a message at the top of the screen (as browsers do) that summarizes the errors encountered, in the likes of "X required fields where not filled". And then a more detailed error closer to each of the fields that could not be validated.
That way, the information about the mistakes is still visible while the user is correcting them.

Categories

Resources