How to receive the input string when ChildContent is set in PromptAsync of SfDialogService

I implemented as per the following URL, but promptText is returned as an empty string. How can I receive the input string? In addition, there seems to be a problem with the initial dialog display where subsequent processes do not work after OK or Cancel is pressed.

https://blazor.syncfusion.com/documentation/predefined-dialogs/customization#customize-dialog-content

package version: 20.2.0.44


8 Replies

VJ Vinitha Jeyakumar Syncfusion Team September 19, 2022 01:14 PM UTC

Hi Takuya,


Currently, we are validating your reported query. we will update you the further details on or before 21st September 2022.

Regards,
Vinitha


VJ Vinitha Jeyakumar Syncfusion Team September 21, 2022 12:59 PM UTC

Hi Takuya,


Your requirement to get the input string value can be achieved by adding bind-value to the textbox control. please check the code below,'

Code snippet:
<div>
        <SfButton @onclick="@PromptBtn">Prompt</SfButton>
    </div>
@code {
    public string textValue { get; set; }
    private async Task PromptBtn()
    {
        string promptText = await DialogService.PromptAsync(null, "Join Chat Group", new DialogOptions()
            {
             
        ChildContent =
    @<table class="Table">
                        <tbody>
                            <tr>
                                <td>
                                    <label>Enter your name: </label>
                                </td>
                                <td>
                                <SfTextBox @bind-Value="@textValue" Type="InputType.Text"></SfTextBox>
                                </td>
                            </tr>
                        </tbody>
    </table>
    });
        Console.WriteLine("Entered Value: " + textValue);
    }
}


Regards,
Vinitha


TA Takuya September 21, 2022 02:01 PM UTC

Thank you. I was able to receive the input values. However, the following problem has not been resolved.

In addition, there seems to be a problem with the initial dialog display where subsequent processes do not work after OK or Cancel is pressed.

For example, if you type 'a' the first time and press OK, nothing is logged. However, if you enter 'b' a second time and press OK, the log for 'b' will be output.



VJ Vinitha Jeyakumar Syncfusion Team September 22, 2022 02:04 PM UTC

Hi Takuya,


Currently, we are validating your reported query. we will update you the further details on or before 26th September 2022.

Regards,
Vinitha


VJ Vinitha Jeyakumar Syncfusion Team September 26, 2022 09:16 AM UTC

Hi Takuya,

We have considered your reported issue "Codes after PromptAsync are not calling for the first time when we use childContent in predefined Dialog" as a bug from our end and the fix for the issue will be included with our upcoming patch release on 4th October 2022.

Now you can track the status of the reported issue through the feedback below,

Regards,
Vinitha


VJ Vinitha Jeyakumar Syncfusion Team October 14, 2022 05:41 AM UTC

Hi Takuya,


We have included the fix for the issue "Codes after PromptAsync are not calling for the first time when we use childContent in predefined Dialog" with our patch release version 20.3.49. So please upgrade your package to the latest to resolve the issue from your end.



Regards,
Vinitha


TA Takuya October 14, 2022 11:39 AM UTC

Thanks for the fix!



VJ Vinitha Jeyakumar Syncfusion Team October 17, 2022 06:05 AM UTC

Hi Takuya,


You are welcome.

Regards,
Vinitha

Loader.
Up arrow icon