-
Notifications
You must be signed in to change notification settings - Fork 101
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
Client validations not working when using PropertyVms to create Dynamic Forms. #95
Comments
Could you post your code? |
Sorry for the delay and thanks for your quick response. Somehow I was misplaced my code for the required validation attribute. Now it's working properly for validations. But I faced one more problem with nested forms creation in dynamic PropertyVms. It always gives My code is as below,
I also tried it with choices such as #81 (comment) but unfortunately, it doesn't fulfill my requirements with TextBox control. |
One thing you can do is create a static model that does what you want (like
in the examples), then call ToPropertyVms() on it, then examine it in the
debugger, that shows you what objects you need
…On Tue, 31 Mar 2020, 12:41 avanisculptsoft, ***@***.***> wrote:
Sorry for the delay and thanks for your quick response. Somehow I was
misplaced my code for the required validation attribute. Now it's working
properly for validations.
But I faced one more problem with nested forms creation in dynamic
PropertyVms. It always gives
exception the same as #50 (comment)
<#50 (comment)>
.
My code is as below,
`var lasers = new[] {
new PropertyVm(typeof(string) , "outer.Left")
{
DisplayName = "Left",
NotOptional =true,
GetCustomAttributes = () => new object[] { new
DataTypeAttribute("TitleTol") }
},
new PropertyVm(typeof(string) , "outer.Right")
{
DisplayName = "Right",
NotOptional =true,
GetCustomAttributes = () => new object[] { new
DataTypeAttribute("TitleTol") }
},
};
var formModel = new[]
{
new PropertyVm(typeof(object) , "outer")
{
DisplayName = "Laser Alignment",
NotOptional =true,
Value=lasers
},
};`
I also tried it with choices such as #81 (comment)
<#81 (comment)>
but unfortunately, it doesn't fulfill my requirements with TextBox control.
Is there any other way to do the same?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#95 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACDJ6U3RRUPDL5OHYBPLHTRKHJH5ANCNFSM4LWIVYMQ>
.
|
#73 (comment)
I've tried to add a RequiredAttribute into the GetCustomAttributes Func as you mentioned in the above issue. But somehow client validations not working in my case. If possible then give some suggestions on how to use RequiredAttribute into the GetCustomAttributes Func.
I'm using PropertyVms to create Dynamic Forms where my model is also dynamic to create PropertyVms. So I'm unable to use FormFactory.Attributes.
Thanks in advance.
The text was updated successfully, but these errors were encountered: