previous | index | next

Using Standard Converters

The standard integer converter is provided by the javax.faces.convert.IntegerConverter class.

Set the converter for the spinner in its constructor, like this:

public class UISpinner extends UIInput {
   ...
   public UISpinner() {
      setConverter(new IntegerConverter()); // to convert the submitted value
      setRendererType(null);                // this component renders itself
   }
   ...
}

Here is the complete code for UISpinner.java.


previous | index | next