Using VS 2010, MVC3, Razor view engine
When using NetAdvantage 2011.1 My form works fine.
When upgrading to NetAdvantage 2011.2 it breaks with this error : Property was not found.This error happens for ALL "TextEditorFor" fields. It does NOT happen for MaskEditorFor, DatePickerFor, or CurrencyEditorFor.
Partial Stack Trace: at Infragistics.Web.Mvc.HelperExtensions.GetDataAnnotationAttributes(HtmlHelper helper, String name) at Infragistics.Web.Mvc.InfragisticsSuite`1.AdjustForDataAnnotations(HtmlHelper helper, ModelBase model, String name, Boolean number, Boolean date) at Infragistics.Web.Mvc.InfragisticsSuite`1.InternalTextEditor(String fullName, String name, Object value) at Infragistics.Web.Mvc.InfragisticsSuite`1.TextEditorFor[TProperty](Expression`1 expression)
The code looks like this: @(Html.Infragistics().TextEditorFor(model => model.Item.setting).ID("FieldName").RenderInContainer(true).Width(200).TextMode(TextEditorTextMode.Text).SelectionOnFocus(TextEditorSelectionOnFocus.SelectAll).ReadOnly(true).Render())
I reverted back to 2011.1 and the code began working correctly. When going back to 2011.2, the error reappeared.
2011.2 DLL details are:Product Version: 3.11.2.2045Date Modified: 12/20/2011 3:29 AM (I'm in central time zone of USA).
2011.1 DLL details are:Product Version: 3.11.2.2030Date Modified: 09/05/2011 5:37 AM (I'm in central time zone of USA).
One correction. It´s not happening on every texteditorfor. It apears to only happen if the model is not so simple (as above). if the field is attached to a simple model.field, then it works.
Thanks,Tony
Hello Tony,
Thank you for posting in our forums.
We are not able to reproduce the behavior in our environment(using the RTM and the latest SR of v11.2)
So we guess that the issue is coming from the model . As you have mentioned
TextEditorFor(model => model.Item.setting) not working
TextEditorFor(model => model.setting) working
Can you please share what is the model in order to continue investigating the issue?
Hope hearing from you.
The model is a wrapper for two other classes.
This is not my exact scenario, of which I cannot go into specifics. However here is a similar example:Suppose you have a Customer class and an address class, each with their own properties. I have created a ViewNameModel class that has a property for Customer and Address. This is what is passed into the view. I then have added editors for each of Customers properties and Address's properties. This is what stopped working with 2011.2, but had previously been working in 2011.1.
Using the above scenario, I would have code like this:@(Html.Infragistics().TextEditorFor(model => model.Customer.Name).ID("FieldName").RenderInContainer(true).Width(200).TextMode(TextEditorTextMode.Text).SelectionOnFocus(TextEditorSelectionOnFocus.SelectAll).ReadOnly(true).Render())
Previously, the above code worked with 2011.1. It still works if I use the other "editorfor"s such as MaskEditorFor, DatePickerFor, and CurrencyEditorFor, just not with TextEditorFor.
Hope that helps.
Thank you for the clarification about the structure of the model.
I was able to reproduce the issue with the latest service release of v11.2 (2045)
I created a support ticket on your behalf CAS-81060-H3V3JQ
and will keep you updated through the customer system.
Thank you for reporing this.
Were you able to reproduce the issue with this information?