2012-08-10 65 views
2

我試圖設置寬度爲richfaces日曆,使用style="width:60px",但它不起作用。如何設置richfaces日曆的寬度?

<rich:calendar id="givenDate" name="givenDate" 
    enableManualInput="true" style="width:60px" 
    datePattern="MM/dd/yyyy" value="#{shotController.adminDate}" 
    immediate = "true" required="true" 
    requiredMessage="#{msg.requiredmsg}" popup="true" /> 

任何人都可以幫忙嗎?

回答

7

<rich:calendar>標籤組件是許多組件的組成部分,您可以設置每個組件的樣式。對於輸入,你應該使用inputStyle財產,或inputClass的CSS定義的類:

<rich:calendar id="givenDate" name="givenDate" 
    enableManualInput="true" 
    <!-- this will be the style for the input textbox --> 
    inputStyle="width:60px" 
    datePattern="MM/dd/yyyy" value="#{shotController.adminDate}" 
    immediate = "true" required="true" 
    requiredMessage="#{msg.requiredmsg}" popup="true" /> 

另一種解決方案可能會被重寫CSS樣式的特定日曆組件。完整列表可在RichFaces Component appendix A: Style classes中找到。

更多信息:

+0

我都嘗試inputStyle和inputClass,好像值不宜服用。我看了一下RF風格類的日曆部分,它沒有寬度參數。 – user1413819 2012-08-10 17:28:57

+0

您需要設置日曆的哪個日曆內部組件:輸入,彈出...? – 2012-08-10 17:39:41

+0

inputStyle屬性工作正常,你嘗試CTRL + SHIFT + R刷新樣式? – gaffcz 2012-08-11 06:27:51

0

如果有人仍然在尋找一個答案:要設置輸入文本框的「inputSize」屬性可以使用的大小。例如

inputSize="10" 

這將設置文本框的大小爲10個字符的長度。

參考:https://community.jboss.org/thread/8802