2012-02-01 28 views
1

我在我的jsf <ice:panelPopup頁面有一個selectInputText,在單擊按鈕時會調用該頁面。自動完成列表在selectInputText下未正確對齊

我正面臨的問題是selectInputText有自動完成列表,列表顯示在我的jsf頁面的右下角。我如何使自動完成列表顯示在selectInputText的正下方。下面是我的selectInputText的屏幕截圖 你可以看到我的列表出現在右下角,但我列出了列表值。

問候

http://s17.postimage.org/j86xpgnxr/screenshot.png

我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

a http://s7.postimage.org/46jk4tka3/autocomplete.png

+0

您正在使用哪種文件類型? – BalusC 2012-02-01 12:09:53

+0

@BalusC將我的標題信息添加到上面作爲更新1 – user75ponic 2012-02-01 12:30:51

+0

Doctype看起來沒問題。你是否在所有瀏覽器或僅在IE瀏覽器中看到了這一點?你使用ICEfaces自己的CSS還是以某種方式覆蓋它?如果你在所有瀏覽器中都看到了這一點,並且你不覆蓋ICEfaces自己的CSS,那麼我會將它作爲ICEfaces球員的錯誤報告和/或檢查是否沒有更新的版本。 – BalusC 2012-02-01 12:36:09

回答

1

這可能會幫助你http://jforum.icesoft.org/JForum/posts/list/16636.page

,但我發現,它只是針對IE7的工作,所以我稍微改變了代碼中ie7,8,9工作。這是我的代碼

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; 
            } 
1

因此我不能發表評論直接,但(< 50代表),我將它張貼作爲一個答案。正如BalusC所述,1.8.2中存在一個bug,導致在IE8的其他地方渲染建議列表。這是一個關於相對/絕對定位的問題。所以解決方案是覆蓋iceSelInpTxtList的css位置屬性。或者,您可以嘗試修改封閉容器(更改位置屬性)。我會提供我們的解決方案,但目前我無法訪問和搜索代碼。

+0

感謝您的回答。如果你能提供一些解決方案,我將很感激,因爲我在過去的兩天中一直在努力。讚賞。 – user75ponic 2012-02-02 12:01:52

+0

嗯,據我所知,我們有以下設置:'auotcompletetxt(position:static)','iceSelInpTxtList(position:absolute)'。另外,我們在主要模板中添加了',這樣IE 8就使用了browsermode:ie8和documentmode:ie8-standard 。 – 2012-02-02 12:15:06

+0

有一個疑問是我有selectInputText,我沒有自動完成和inputList。 – user75ponic 2012-02-02 15:54:39