验证屏幕上的数据不起作用 [英] Validating data on screen doesn't working

查看:74
本文介绍了验证屏幕上的数据不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi,

maybe someone could help me with my problem. The validation fires and the invalid data is identified with the red box (I have to press twice the save button, not idea why - I guess for the asynchronous calls -). However, when the data is corrected to pass the rule the property error does not clear. The red box remains around the field. Any idea what would be causing it not to clear?

myapp.AddEditSet.created = function (screen) {

    screen.taSet.addChangeListener("Descripcion",
    function (e) {
        var accion = screen.Accion;

        var contentItem = screen.findContentItem("Descripcion");
        if (screen.taSet.Descripcion === "" || screen.taSet.Descripcion == null) {

            contentItem.validationResults = [
            new msls.ValidationResult(screen.taSet.details.properties.Descripcion, "This field is required.")];
        }
    });
}


推荐答案

请参阅这篇文章的答案.

See the answer to this post.

http ://social.msdn.microsoft.com/Forums/zh-CN/08af462d-a094-44b2-bf3c-a3cd5f7a40a9/hmtl-client-screen-validation?forum = lightswitch


这篇关于验证屏幕上的数据不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆