Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize form data with static SSR #33630

Merged
merged 3 commits into from
Sep 17, 2024
Merged

Initialize form data with static SSR #33630

merged 3 commits into from
Sep 17, 2024

Conversation

guardrex
Copy link
Collaborator

@guardrex guardrex commented Sep 17, 2024

Fixes #33629

Javier ... Adding a bit to reflect your remarks at dotnet/aspnetcore#51978 (comment).

The code is a bit long for such a simple concept, so we could have a pseudo-code version here (as you have in your PU issue remark), and I can cross-link to the Blazor sample app where this fully working component example can live. This would merely show ...

protected override void OnInitialized() => Model ??= new();

protected override void OnParametersSet()
{
    if (Model!.Id == default)
    {
        LoadData();
    }
}

Mmmmmmmm 🤔 ... I do kind'a like that approach. Anyway, you can review this in this form, and I'll take care of moving it on a future commit.

Changed my mind on that ☝️! Our BWA sample adopts global interactive SSR, so it isn't ideal for just placing it. Let's just roll with this. It's long, but it's good to see the full component.

... and is there anything else that you'd like to add?


Internal previews

📄 File 🔗 Preview link
aspnetcore/blazor/forms/binding.md ASP.NET Core Blazor forms binding

@guardrex guardrex self-assigned this Sep 17, 2024
@guardrex guardrex requested a review from javiercn September 17, 2024 14:47
@guardrex guardrex merged commit d3e6498 into main Sep 17, 2024
3 checks passed
@guardrex guardrex deleted the guardrex-patch-1 branch September 17, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Initalize form data with static SSR
2 participants