2012-08-10 64 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