-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
ABP dynamic form adds default value to AbpInputTagHelper #4548
Comments
Can you share your full code class (you may need to create new |
I think that's why the problem happened. I try to create public class CreateEditProductViewModel
{
public string Name { get; set; } = "Default";
}
public class CreateModalModel : MyProjectPageModel
{
[BindProperty]
public CreateEditProductViewModel ViewModel { get; set; } = new CreateEditProductViewModel(); // this way works.
// .ctor
public virtual Task OnGetAsync()
{
ViewModel = new CreateEditProductViewModel(); // or this way.
return Task.CompletedTask;
}
} There are some questions:
|
Hi, It seems like creating a new instance of the model in OnGet method is required. I couldn't find any other way to make it work with
No. But it would be nice.
It doesn't provide for default AspNet Core input tag helper.
It doesn't use any default value, so no need to initialize a new model in OnGetAsync. |
So you need to initialize instances? |
The first way:
The second way:
I thought the Name input box to use the default value on the creation modal page, but not really, neither of the above two ways worked.
The text was updated successfully, but these errors were encountered: