Problem with validation

3 replies. Last post: October 5, 2011 9:18 PM by Yudi
Tags :
  • New Discussion
  • New Question
  • New Product Feedback

Hello,

I’m having trouble getting a UXTextBox to show validation errors with the red outline and default call out

I have an entity on the server side (using EF 4.1 Code First)

class WebAccess
{
[Email]
public string Email { get; set; }

}

class User
{
// this one is required by default because it’s a complex type
public WebAccess WebAccess { get; set; }
}

EmailAttribute is a custom validation attribute. I’ve validated it works and that it gets copied over to the server.

In the view, I set the DataContext:

<ui:UXPage.DataContext>
<ViewModels:SuperAdministratorViewModel />
</ui:UXPage.DataContext>

And then:

<ui:UXItemsControl DataContext="{Binding NewAdministrator}" ItemContainerStyle="{StaticResource FieldLabelStyle}">

<ui:FieldLabel Header="Email" Style="{StaticResource RequiredFieldLabelStyle}">
<ui:UXTextBox Style="{StaticResource SimpleTextBoxStyle}"
Text="{Binding Path=WebAccess.Email, Mode=TwoWay, ValidatesOnDataErrors=True}"
ui:DataBinding.ClearErrorOnTextInput="True" />
</ui:FieldLabel>
</ui:UXItemsControl>

However, when I type and move the focus to another control, the validation won’t show at all

What am I missing here?

Thanks
Georgios

All times are GMT -5. The time now is 10:08 PM.
Previous Next