在RichFaces 4.x中移动弹出窗口后弹出阴影位置不正确 [英] Incorrect popup shadow position after moving popup in RichFaces 4.x

查看:63
本文介绍了在RichFaces 4.x中移动弹出窗口后弹出阴影位置不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有自动调整属性的弹出窗口。面板包含搜索,搜索按钮,数据表和数据循环器的字段。按下搜索按钮或在datascroller中选择页面调用javascript。 Javascript用于将弹出窗口移动到浏览器可见区域的中心。所有工作都很好,除了popup阴影在弹出窗口移动时保留前一个面板位置。

I have popup with autosized attribute. Panel contains fields for search, search button, datatable and datascroller. After press search button or select page in datascroller javascript is called. Javascript is used for move popup to center of browser visible area. All work fine, except popup shadow is stay for previous panel position when popup is already moved.

按钮代码:

<a4j:commandButton id="searchButton"
    value="#{msg.search}"
    action="#{chAction.searchSegments}"
    styleClass="richButton"
    render="clientCategoryCandidateTable"
    oncomplete="centerPanel();" />

Javascript:

Javascript:

function centerPanel() {
    var modalPanel = #{rich:component('addToSegmentsPanel')};
    var windowWidth = document.documentElement.clientWidth;
    var windowHeight = document.documentElement.clientHeight;
    var popupWidth = modalPanel.width();
    var popupHeight = modalPanel.height();
    modalPanel.setLeft(Math.max(0, (windowWidth-popupWidth)/2));
    modalPanel.setTop(Math.max(0, (windowHeight-popupHeight)/2));
};

我尝试过不同版本的javascript,但副作用相同:

I have tried different version of javascript, but with same side effect:

function centerPopup() {
    var popup = #{rich:component('addToSegmentsPanel')};
    popup.moveTo(Math.max(0, (window.innerWidth-popup.width())/2),
                 Math.max(0, (window.innerHeight-popup.height())/2));
};

截屏:

Screen shots:

感谢您提供任何帮助或意见。

Thanks for any help or comments.

推荐答案

问题已解决在javascript结尾添加隐藏和显示:

Problem was fixed with adding hide and show in end of javascript:

modalPanel.hide(); modalPanel.show();

这篇关于在RichFaces 4.x中移动弹出窗口后弹出阴影位置不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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