简体   繁体   English

如何在modalpanel中添加滚动?

[英]How to add scroll in modalpanel?

I have a modal panel which contains the dynamically included page. 我有一个模式面板,其中包含动态包含的页面。 The page contains search form. 该页面包含搜索表单。 After click the search button it shows the contents. 单击搜索按钮后,它将显示内容。

Intially the page height is less than 300px. 页面高度最初小于300像素。 After search the page height is more than 600px. 搜索后,页面高度超过600像素。 So i cannot set the height statically. 所以我不能静态设置高度。 At that time of search the modalpanel partial contents are hide in the browser. 在搜索时,模式面板的部分内容隐藏在浏览器中。 So i need to put the scrollbar when the page is larger than browser. 所以我需要在页面大于浏览器时放滚动条。

How can i achieve that? 我该如何实现?

define 限定

<style>
.scroll_div{
 overflow: scroll;
 width:100%;
 height:100%;
}
</style>

and apply 并申请

<rich:modalPanel id="panel" width="350" height="100">
 <div class="scroll_div">

Source :http://community.jboss.org/message/66213 资料来源:http://community.jboss.org/message/66213

Or 要么

override the css modal panel 覆盖CSS模式面板

.rich-mpnl-panel {
    position: inherit;
}

it work for me by this code: 它通过以下代码为我工作:

    .dr-mpnl-pnl {
        overflow: auto !important
    }

and add this component: 并添加以下组件:

<rich:componentControl for="dynadetailModalPanel"
    attachTo="showPanelButton" operation="show" event="onclick" />

<rich:modalPanel id="dynadetailModalPanel" height="500" width="500" >
         ...

添加所需的高度并设置流,以滚动到样式丰富的modalPanel。

<rich:modalPanel style="height:600px;overflow:scroll;">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM