Css 如何使richfaces向上弹出popuppanel

Css 如何使richfaces向上弹出popuppanel,css,jsf-2,position,richfaces,popuppanel,Css,Jsf 2,Position,Richfaces,Popuppanel,该链接包含richfaces 4 popuppanel的一个示例: 代码如下: <rich:toolbar height="26px" id="tb"> <rich:toolbarGroup location="right"> <h:outputLink value="#"> <rich:componentControl event="click" operation="show" target="ls"

该链接包含richfaces 4 popuppanel的一个示例:

代码如下:

<rich:toolbar height="26px" id="tb">
    <rich:toolbarGroup location="right">
        <h:outputLink value="#">
            <rich:componentControl event="click" operation="show" target="ls">
                <a4j:param name="event" value="event" noEscape="true" />
                <rich:hashParam>
                    <a4j:param noEscape="true" name="top"
                               value="jQuery(#{rich:element('tb')}).offset().top + jQuery(#{rich:element('tb')}).height()" />
                    <a4j:param noEscape="true" name="left"
                               value="jQuery(#{rich:element('tb')}).offset().left + jQuery(#{rich:element('tb')}).width() - p_width" />
                </rich:hashParam>
            </rich:componentControl>
            Search
        </h:outputLink>
    </rich:toolbarGroup>
</rich:toolbar>
<rich:popupPanel header="Enter Search Terms" id="ls" autosized="true" modal="false" moveable="false" resizeable="false" followByScroll="false" >
    <h:panelGrid columns="3">
        <h:outputText value="Search:" />
        <h:inputText />
        <h:outputLink onclick="#{rich:component('ls')}.hide(event); return false;" value="#">Search
        </h:outputLink>
    </h:panelGrid>
</rich:popupPanel>
<h:outputScript type="text/javascript" target="body">
    p_width = #{rich:component('ls')}.width();
</h:outputScript>

搜寻
搜寻
p#u width=#{rich:component('ls')}.width();

但弹出窗口出现在随机位置,即有时在栏下,然后必须滚动,有时在上方。是否可以确保它在连接到条形图时始终显示在条形图的正上方?

顶部和
左侧
参数设置面板的位置,将其更改为您希望面板的位置,或直接调用该方法:

RichFaces.component('panelId').show(null, {top: "800px", left: "500px"})
您使用的是示例中专门将面板设置在栏下的部分,因此当面板出现在那里时,应该不会感到意外