by Jacob Goldstein

 Comments (1)

Created

June 10, 2009

The Spark NumericStepper component has two built in properties that allow a developer to format the NumericStepper value in any way that they choose. For example, if you want to add a “$” to the front of your value, you can do so using these properties. The properties are valueFormatFunction and its companion function, the valueParseFunction. Each of these properties works the same way: you specify the name of a function that you write to perform the desired action. One common mistake is to only use the valueFormatFunction, and then wonder why the NumericStepper no longer works as expected. The reason is that if you convert the value to a string in order to append something to it, you then have to make use of an valueParseFunction to extract the value from the string in order for the NumericStepper to be able to use it again. In most cases these properties should be used together – the valueFormatFunction to specify a function to format the value and the valueParseFunction to specify the function to extract the value. Examples can be found here: valueFormatFunction; valueParseFunction

COMMENTS

  • By Clayton Cisar - 6:05 PM on August 30, 2010   Reply

    Whoa!, this was a top excellent post. The theory is that I’d like to write this way as well – taking time and substantial effort to make a good blog… but nonetheless , what can I say… I procrastinate a good deal and never seem to get something accomplished

ADD A COMMENT