【发布时间】:2018-09-06 03:09:36
【问题描述】:
迁移到 Liferay 6.2 后,<liferay-ui:captcha> 自定义停止工作:
- 原始输入不再隐藏
- 刷新链接出现(我们需要隐藏它,或者翻译标签并删除错误的工具提示 - 它在悬停时闪烁)
LFR 6.1 代码:
xmlns:form="http://www.springframework.org/tags/form"
xmlns:liferay-ui="http://liferay.com/tld/ui"
<liferay-ui:captcha url="${captchaURL}"/>
<label for="captchaText" >
Opiste text z obrazku
</label>
<form:input id="captchaText" path="captcha" />
自定义验证码组件的正确方法是什么?
我尝试替换我们的 id 以匹配 Liferay 生成的字段的 id,但它不起作用。
Liferay 生成的代码:
<div class="taglib-captcha" id="yui_patched_v3_11_0_1_1425121596007_13262">
<img alt="Text to Identify" class="captcha"
id="_pspmlmuserportlet_WAR_pspmlmuserportlet_captcha"
src="..."/>
<span class="refresh" onmouseover="Liferay.Portal.ToolTip.show(this, 'Refresh CAPTCHA')"
data-title="" id="yui_patched_v3_11_0_1_1425121596007_13261">
<a href="javascript:;" class=" taglib-icon" id="_pspmlmuserportlet_WAR_pspmlmuserportlet_refreshCaptcha">
<img id="refreshCaptcha" src=".../refresh.png" alt="Refresh CAPTCHA" title="Refresh CAPTCHA"/>
<span class="taglib-text hide-accessible">Refresh CAPTCHA</span>
</a>
</span>
<div class="form-group" id="yui_patched_v3_11_0_1_1425121596007_14890">
<label class="control-label" for="_pspmlmuserportlet_WAR_pspmlmuserportlet_captchaText">
Text Verification <span class="label-required">(Required)</span>
</label>
<input class="field form-control" id="_pspmlmuserportlet_WAR_pspmlmuserportlet_captchaText"
name="_pspmlmuserportlet_WAR_pspmlmuserportlet_captchaText" type="text" value="" size="10"/>
</div>
</div>
我可能可以通过 jQuery 来完成,但我会对正确的方式感兴趣。
谢谢
【问题讨论】:
标签: liferay liferay-6 liferay-aui