Search code examples
javajavascriptjsf-2richfaces

Rich faces : how to add static text beside value on InputNumberSlider tooltip?


I'm Using rich faces 4 I'm using input number slider

 <rich:inputNumberSlider value="10" width="500" minValue="1" maxValue="30" step="1"   showInput="false"  enableManualInput="false" showArrows="false" tooltipClass=""  showTooltip="true" label="Days" /> 

i want to add word "Days" in the tool tip , to be "10 Days" instead of "10" .


Solution

  • RichFaces API on <rich:inputNumberSlider> says:

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

    In short - label is used in all components as a parameter for jsf messages.

    I have looked into richfaces sources for <rich:inputNumberSlider> ui javascript. It is possible to change javascript in certain places, adding hardcoded 'Days' string. To achieve this I can't think of any other options than recompiling the sources.

    I suggest specifying somewhere else, that this slider measures days.