本文介绍了自动完成列表未在selectInputText下正确对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的jsf <ice:panelPopup页面中有一个selectInputText,单击按钮即可调用该页面.

I have a selectInputText in my jsf <ice:panelPopup page which gets invoked upon clicking a button.

我面临的问题是selectInputText具有自动完成列表,并且该列表正显示在我的jsf页面的右下角.如何使自动完成列表显示在selectInputText的正下方.以下是我的selectInputText的屏幕截图您可以看到我的列表显示在右下角,尽管我将列表值设为灰色.

Issue I am facing is selectInputText has autocomplete list and the list is getting displayed in the right bottom corner of my jsf page. How can I make the autocomplete list displayed just below the selectInputText. Below is the screenshot of my selectInputTextYou can see my list getting appeared in the right bottom corner, I have greyed out the list values though.

致谢

我的jspx中的代码

<h:panelGrid id="popupBody2" width="100%" cellpadding="0" cellspacing="0" column="1">
                <ice:form id="frm">                                        
                 <tr>
<td>
                        <h:outputText value="Select City" />                        
                          <ice:selectInputText rows="10" width="300"
                        listVar="city"
                        valueChangeListener="#{bean.method}"
                        listValue="#{bean.list}">
                         <f:facet name="selectInputText">
                   <ice:panelGrid columns="3" columnClasses="cityCol">
                         <ice:outputText value="#city.state}"/>                           
                   </ice:panelGrid>
  </f:facet>
          </ice:selectInputText>           
                    <ice:panelGrid columns="2">                        
                        <ice:outputText id="country" 
                                      visible="false"  value="#{bean.currentCity.country}"/>                       
                    </ice:panelGrid>

更新1

<f:view xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:ice="http://www.icesoft.com/icefaces/component"
        xmlns:t="http://myfaces.apache.org/tomahawk">
        <ice:outputDeclaration doctypeRoot="HTML"
                doctypePublic="-//W3C//DTD HTML 4.01 Transitional//EN"
                doctypeSystem="http://www.w3.org/TR/html4/loose.dtd" />              
        <html>
        <head>

        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></meta>
        <title>Employees List</title>
        <link rel='stylesheet' type='text/css' href='./xmlhttp/css/xp/xp.css' />
        </head>

更新2

推荐答案

这可能会帮助您 http://jforum.icesoft.org/JForum/posts/list/16636.page

但是我发现它将只对ie7起作用,因此我稍微更改了代码以使其在ie7,8,9中起作用.这是我的代码

but I found that it will just work for the ie7 so I slightly changed the code to work in ie7,8,9. Here is my code

if (Prototype.Browser.IE || navigator.userAgent.indexOf("MSIE 8") > -1) {
                                       var savedPos = element.style.position;
                                       element.style.position = "relative";
                                       update.style.left = element.offsetLeft + "px";
                                       update.style.top = (element.offsetTop + element.offsetHeight) + "px";
                                       element.style.position = savedPos;
                                   }

这篇关于自动完成列表未在selectInputText下正确对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 22:50