我正在使用丰富的面孔4 我正在使用输入数字 slider
<rich:inputNumberSlider value="10" width="500" minValue="1" maxValue="30" step="1" showInput="false" enableManualInput="false" showArrows="false" tooltipClass="" showTooltip="true" label="Days" />
我想在工具提示中添加“Days”一词,将其变为“10 Days”而不是“10”。
最佳答案
RichFaces API on <rich:inputNumberSlider>
说:
The "label" attribute is a generic attribute. The "label" attribute provides an association between the component and the message that the component (indirectly) produced. This attribute defines the parameters of a localized error and informational messages that occur as a result of conversion, validation, or other application actions during the request processing lifecycle. With the help of this attribute you can replace the last parameter substitution token shown in the messages. For example, {1} for "DoubleRangeValidator.MAXIMUM" , {2} for "ShortConverter.SHORT".
简而言之 - 标签在所有组件中用作 jsf 消息的参数。
我调查过richfaces sources对于 <rich:inputNumberSlider>
用户界面 JavaScript。可以在某些地方更改 javascript,添加硬编码的“Days”字符串。为了实现这一目标,除了重新编译源代码之外,我想不出任何其他选择。
我建议在其他地方指定该 slider 测量天数。
关于java - 丰富的面孔 : how to add static text beside value on InputNumberSlider tooltip?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10995444/