使用Alloy UI的LifeRay表单验证 [英] LifeRay form validation using Alloy UI

查看:67
本文介绍了使用Alloy UI的LifeRay表单验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用LifeRay 6.1.2.它具有内置的Alloy UI 1.5.框架.因此,我尝试重现表单验证示例(我复制了所有代码),但无法按预期工作(DOM中的错误标签,但在窗体中不可见(请参见EDIT1)):

I use LifeRay 6.1.2. And it have built-in Alloy UI 1.5. framework. So I try to reproduce this form validation example (I copied all code), but it don't work as expected (error labels in DOM, but they are don't visible in form (see EDIT1)):

预期结果是(您可以使用上面提供的链接尝试实际示例):

Expected result is (you can try yourself live example using link provided above):

哪里有问题?怎么解决呢?谢谢.

Where is problem? How to solve it? Thanks.

经过一番研究,我意识到,如果我从错误消息的DIV标记中删除aui-form-validator-message CSS类(它是由LifeRay生成的,我没有添加它),则错误消息变得可见.奇怪

After some research, I realized that if I delete aui-form-validator-message CSS class from error message's DIV tag (it generated by LifeRay, I'm not adding it), then error message become visible. Strange..

推荐答案

您应该发布自己的代码,否则将很难回答. 无论如何,如果您愿意,可以尝试使用aui验证程序标记,例如:

You should post your own code, or it's difficult to answer. Anyway if you want you could try the aui validator tag for example:

<aui:input name="name" value="${name}" label="name">
     <aui:validator name="required" errorMessage="your-message-here"></aui:validator>
</aui:input>

了解详情@ http://drewblessing.com/blog/-//blogs/34509

希望有帮助!

这篇关于使用Alloy UI的LifeRay表单验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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