Dojo Slider

Complete Java Server Faces (JSF) Tutorial - JSF Tutorials. JSF Tutorials at Rose India covers everything you need to know about JSF, This JSF Tutorial contains readable and interesting content organized in proper and sequential manner. Each concept has been explained by simple examples so that you can understand easily and implement immediately into your java web application. It provides coverage of key JSF concepts such as User Interface(UI) components, Renderers, Backing beans, Validators, Converters, Navigation, Event handling, Expession language, Messages etc...

Dojo Slider


In this section, you will learn about slider and how to create a slider in dojo.

Slider : A slider is a GUI (Graphical User Interface) component. In other words a slider is a scale with handle a dragged values up/down or left/right. Calling the dojo slider by using the dojo.require("dijit.form.Slider") that provides dijit.form.HorizontalSlider, dijit.form.VerticalSlider and all rules and label classes. 

The following code fills a simple textbox called horizontalSliderValue.

Here is the code of Program:


<title>Slider Example 1</title>

  <style type="text/css">
  @import "../resources/dojo.css";
  @import "../dijit/themes/tundra/tundra.css";
  <script type="text/javascript" src="dojo.xd.js" djConfig="parseOnLoad: true"></script>

  <script type="text/javascript">

  <body class="tundra">
  <div id="horizontalSlider" dojoType="dijit.form.HorizontalSlider"
 value="5" minimum="-10" maximum="10" discreteValues="11"
 onChange="dojo.byId('horizontalSlider').value = arguments[0];"

Output of the Program:

When you click the left side button (-) then decrease the value of slider and click the right side button (+) then increase the value of slider.