InputBox Dialog

Radzen has a MessageBox/Confirm/Dialog component that can be used to display short messages to the user or to make the user confirm an action (e.g. "Do you really want to delete XYZ?").

Another feature that would be very helpful is an "Input Box" component.

Simply by invoking a method, a dialog box is shown that has a title, a prompt text and a text box (with an optinally prefilled text). When the user clicks OK, the dialog is closed and the text that is currently in the textbox is returned to the calling method for further processing (e.g. "Please enter your name: [...]").

This would be very helpful because there are often scenarios where a single string input needs to be queried.

Is such a functionality already available or what would be the easiest way to get such a feature set up in Radzen?

Thanks a lot!

Hi @JustJoe,

You can implement this easily:

  1. Create a new page in Radzen e.g. Input.
  2. Add a TextBox and a Button.
  3. Create a property e.g. Value.
  4. Set the Value of the TextBox to ${value}.
  5. Handle the Click event of the Button and use the Close dialog action with Result set to ${Value}.

To use the newly created dialog

  1. Use Open Dialog action with Page set to Input.

  2. Handle the Then event of the dialog - its ${result} implicit parameter will contain the value the user typed in.

1 Like

Cool! Thanks a lot! :slight_smile:

Hi ,
How to do this with multiple values that you want the user to input and return to the process.
e.g. I want the user to input multiple values for a underlaying function call to export data.
I'm using the Radzen designer.

You would need an additional class if you want to pass more than one result. You can define it in the .razor.cs file of the page that opens the dialog.

Hi,
Did that , but was getting this error :slight_smile:

Model is global and not just in the page defined.

We can't tell what the problem is based on this screenshot alone.

@korchev

It was a name conflict name of data and model being the same and there was no Tittem.
problem resolved.
Thank you .