首页 > SAP > FIORI > 输入字段INPUT的有效值校验——–出错问题处理
2019
08-27

输入字段INPUT的有效值校验——–出错问题处理

今天想写一做,当用户输入邮件地址后,用正则表达式判断邮件地址是为有效邮件的功能,如图的效果,
输入字段INPUT的有效值校验--------出错问题处理 - 第1张  | 优通SAP
SAPUI5有标准的例子说明,
Input checks are handled via the validation of the data binding. In this example there are two inputs that are validated (a) while the user types and (b) when the user continues the process. If the built-in validation types are not sufficient you can create your own, like the email type in this example.


,所以就看了一下他代码就把他功能代码COPY到自己的运用中来了,结果发现在自己的程序中总是没效果,输入值后不会提示,然后输入框失去焦点后,输入框里的值就被清空了,而我把此XML,JS拷到WEB IED的一个运用中运行又是正常的,这就难了,就这样COPY代码,折腾了一下午一行行的对代码,最后才发现,我在引用此XML的HTML中定义时少一句:
data-sap-ui-xx-bindingSyntax="complex",加上这句后就正常了。

<html>
        <head>
                <meta http-equiv="X-UA-Compatible" content="IE=edge">
                <meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
               
               
                <script src="./resources/sap-ui-core.js"
                                id="sap-ui-bootstrap"
                                data-sap-ui-libs="sap.m"
                                data-sap-ui-theme="sap_bluecrystal"
                                data-sap-ui-xx-bindingSyntax="complex"
                                data-sap-ui-resourceroots='{"sap.alipay.wt": "./"}'>
                </script>
                <!-- only load the mobile lib "sap.m" and the "sap_bluecrystal" theme -->

                <script>
                                var app = new sap.m.App({initialPage:"idalipay1"});
                                var page = sap.ui.view({id:"idalipay1", viewName:"sap.alipay.wt.view.BuyRegisterSAP", type:sap.ui.core.mvc.ViewType.XML});
                                app.addPage(page);
                                app.placeAt("content");
                </script>
                .....................................

最后编辑:
作者:yangsen
本站为个人博客网站,全由我个人维护,我从事SAP开发13年,其它ERP开发7年,基本都是零售行业。本站记录工作学习的过程, 有SAP相关询问专、兼职工作可随时联系我。 有网站相关的问题可直接在文章下方留言,或者联系我。 邮件:yan252@163.com给我。 QQ:415402519

留下一个回复

你的email不会被公开。