Don't miss out Virtual Happy Hour this Friday (April 26).
Don't miss out Virtual Happy Hour this Friday (April 26).
EPiServer.CMS.UI 7.10.0
Jul 22, 2014
Aug 08, 2014
Falcon/CMS/Edit UI
Closed, Fixed and Tested
1. Add the following class to the project.
[ServiceConfiguration(typeof(ISelectionQuery))]
public class MyCustomItemQuery : ISelectionQuery
{
private readonly SelectItem[] _items;
public MyCustomItemQuery()
{
_items = new[]
{
new SelectItem { Text = "OneTwoThree", Value = "123" },
new SelectItem { Text = "TwoThreeFour", Value = "234" }
};
}
public IEnumerable<ISelectItem> GetItems(string query)
{
return _items.Where(i => i.Text.StartsWith(query));
}
public ISelectItem GetItemByValue(string value)
{
return _items.FirstOrDefault(i => i.Value.Equals(value));
}
}
2. Add the following property and attribute to a page content type.
[AutoSuggestSelection(typeof(MyCustomItemQuery))]
public virtual string TestProperty { get; set; }
3. Create a page of that content type
4. Go to all properties mode
5. Give the test property focus
6. Remove focus from the test property
Observed: The property displays a required validation error.
Expected: No validation error since the property is not marked as required on the model.