Spinner

Spinner is used to provide an input with increment and decrement buttons on an input text.

Spinners
0

Values
Value 1: 0
Value 2: 0.0
Value 3: 0
Value 4: 0
Value 5: 0

Source

<h:form>
       
   	<p:panel header="Spinners">
   		<h:panelGrid id="grid" columns="2" cellpadding="5">
    		<h:outputLabel for="spinnerBasic" value="Basic Spinner: " />
    		<p:spinner id="spinnerBasic" 
    				value="#{spinnerController.number1}"/>
    		
    		<h:outputLabel for="spinnerStep" value="Step Factor: " />
    		<p:spinner id="spinnerStep" 
    				value="#{spinnerController.number2}" stepFactor="0.25"/>
    		
    		<h:outputLabel for="minmax" value="Min/Max: " />
    		<p:spinner id="minmax" 
    				value="#{spinnerController.number3}" min="0" max="100"/>
    		
    		<h:outputLabel for="prefix" value="Prefix: " />
    		<p:spinner id="prefix" value="0" prefix="$" min="0" />

            <h:outputLabel for="ajaxspinner" value="Ajax Spinner: " />
            <p:outputPanel>
                <p:spinner id="ajaxspinner" value="#{spinnerController.number6}">
                    <p:ajax update="ajaxspinnervalue" process="@this" />
                </p:spinner>
                <h:outputText id="ajaxspinnervalue"
                        value="#{spinnerController.number5}"/>
            </p:outputPanel>

    
   		</h:panelGrid>
   	</p:panel>
            	
	<p:commandButton value="Submit" update="display" oncomplete="PF('dlg').show()" />
	
	<p:dialog header="Values" widgetVar="dlg" showEffect="fold" hideEffect="fold">
		<h:panelGrid id="display" columns="2" cellpadding="5">
			<h:outputText value="Value 1: " />
			<h:outputText value="#{spinnerController.number1}" /> 
			
			<h:outputText value="Value 2: " />
			<h:outputText value="#{spinnerController.number2}" /> 
			
			<h:outputText value="Value 3: " />
			<h:outputText value="#{spinnerController.number3}" /> 
			
			<h:outputText value="Value 4: " />
			<h:outputText value="#{spinnerController.number4}" /> 
			
			<h:outputText value="Value 5: " />
			<h:outputText value="#{spinnerController.number5}" /> 
		</h:panelGrid>
     </p:dialog>
            	
</h:form>