3

我正在尝试使用 设置richfaces日历的宽度style="width:60px",但它不起作用。

<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" />

任何人都可以帮忙吗?

4

2 回答 2

9

<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 组件附录 A:样式类中找到。

更多信息:

于 2012-08-10T16:17:08.753 回答
0

如果有人仍在寻找答案:要设置输入文本框的大小,可以使用“inputSize”属性。例如

 inputSize="10"

这会将文本框的大小设置为 10 个字符的长度。

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

于 2013-12-10T08:53:53.523 回答