如何将 JQuery 选择器应用到 Wicket ModalWindow
我正在使用一种漂亮的新 show-your-password-single-char JQuery hacks,我可以将其应用于页面上的所有密码字段,
<script type="text/javascript">
$(document).ready( function() {
$('input:password').dPassword();
});
</script>
但我的更改密码对话框是在 Wicket ModalWindow 中呈现的,
final ModalWindow window = new ModalWindow("change-password-panel");
final PasswordChangePanel panel = new PasswordChangePanel(window, myPasswordValidator);
window.setContent(panel);
add(window);
add(new AjaxFallbackLink<String>("change-password") {
@Override public void onClick(AjaxRequestTarget target) {
window.show(target);
}});
所以它不是' document.ready 上有。
当我的 ModalWindow 显示时,如何安排重新运行 JQuery 选择器?
I'm using one of the spiffy new show-your-password-single-char JQuery hacks, which I can apply to my all password fields on a page with
<script type="text/javascript">
$(document).ready( function() {
$('input:password').dPassword();
});
</script>
But my change password dialog is rendered in a Wicket ModalWindow,
final ModalWindow window = new ModalWindow("change-password-panel");
final PasswordChangePanel panel = new PasswordChangePanel(window, myPasswordValidator);
window.setContent(panel);
add(window);
add(new AjaxFallbackLink<String>("change-password") {
@Override public void onClick(AjaxRequestTarget target) {
window.show(target);
}});
so it isn't there on document.ready.
How can I arrange to re-run the JQuery selector when my ModalWindow has been shown?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试发送回一些 JS 以在 AJAX 调用完成后运行:
最好将选择器的范围限制为模式窗口,但我需要查看代码才能做到这一点。 ;)
Try sending back some JS to run upon completion of the AJAX call:
It's better to restrict the scope of the selector to just your modal window, but I'd need to see the code to be able to do that. ;)