2013-07-26 190 views
2

我想用primeform 3.5的用戶窗體,所有的組件都工作正常,除了selectonemenu,它不能正確呈現。Primefaces SelectOneMenu無法正確呈現文字

它的文本字段沒有顯示任何下拉字段的選擇。

,因爲我沒有我不能發佈圖片太大聲譽

代碼

<p:panelGrid id="jobsGrid" columns="2" style="width:100%;margin-bottom:20px;margin-top:20px; margin-left:20px;margin-right:20px;text-align:left;"> 
    <f:facet name="header"> ----- Quick Job Posting -----</f:facet> 
    <h:outputText value="OLF Number " /> 
    <p:inputText value="#{jobs.jobDetail.OLF_No}" /> 
    <h:outputText value="RRF Number " /> 
    <p:inputText value="#{jobs.jobDetail.RRF_No}" /> 
    <h:outputText value="OLF Status " /> 
    <p:selectOneMenu value="#{jobs.jobDetail.OLF_Status}" style="margin-top:0px;margin-bottom:0px;height:5px;font-size:10px"> 
     <f:selectItem itemLabel="---- Select ----" itemValue="" /> 
     <f:selectItem itemLabel="Approved" itemValue="Approved" /> 
     <f:selectItem itemLabel="Pending Approval" itemValue="Pending Approval" /> 
     <f:selectItem itemLabel="New" itemValue="New" /> 
    </p:selectOneMenu> 

    <h:outputText value="RRF Type " /> 
    <p:selectOneMenu value="#{jobs.jobDetail.RRF_type}" style="margin-top:0px;margin-bottom:0px;height:5px;font-size:10px"> 
     <f:selectItem itemLabel="---- Select ----" itemValue="" /> 
     <f:selectItem itemLabel="Growth" itemValue="Growth" /> 
     <f:selectItem itemLabel="Replacement" itemValue="Replacement" /> 
    </p:selectOneMenu> 

屏幕截圖

enter image description here

我該如何解決這個問題?

+0

後您的圖像,並提供鏈接,我會上傳圖片 –

+0

感謝@jubinPatel,我有圖片鏈接 –

+0

感謝@Sergio更新添加圖像 –

回答

1

這在Primefaces 3.5中絕對是一個問題。我有完全相同的問題,降級到3.4解決了它。

作爲一個數據點,值得注意的是渲染問題僅在通過p:remoteCommand導航到頁面時才存在。正常的基於動作的導航工作正常,至少對我而言。

+0

另一個有趣的信息是,這似乎只是在谷歌瀏覽器中的一個問題,我只是嘗試在Firefox和問題在那裏消失了。 – argh1969

+0

在Primefaces 4.0中仍然存在問題 – argh1969

4

我加入以下CSS到我的網頁此修正了這個問題:在我的selectonemenus

.ui-selectonemenu label.ui-selectonemenu-label{ 
    width:100% !important; 
} 

我也有固定的寬度。 希望這也有助於你的情況。 ;)在http://imageshack.us/