Switch JSP Tag Overview

The Switch JSP tag is a server-side wrapper for the Kendo UI Switch widget.

Getting Started

The Basics

Kendo UI Switch is used to display two exclusive choices.


Below are listed the steps for you to follow when configuring the Kendo UI Switch in the Spring MVC framework.

Step 1 Make sure you followed all the steps from the introductory article on Telerik UI for JSP.

Step 2 Create a new action method.

    @RequestMapping(value = { "/", "/index" }, method = RequestMethod.GET)
    public String index() {
        return "web/switch/index";

Step 3 Add the Kendo UI taglib mapping to the page.

    <%@taglib prefix="kendo" uri="http://www.kendoui.com/jsp/tags"%>

Step 4 Add a switch tag.

<kendo:switchButton name="switch">

Event Handling

Subscribe to Events

You can subscribe to all events exposed by Kendo UI Switch by the handler name.

<kendo:switchButton name="switch" change="switchOnChange">

function switchOnChange(e) {
    kendoConsole.log("Change :: checked: " + e.checked);


Existing Instances

You are able to reference an existing Switch instance via jQuery.data(). Once a reference is established, you are able to use the Switch API to control its behavior.

// Put this after your Kendo Switch tag declaration
    $(function() {
        // Notice that the name attribute of the switch is used to get its client-side instance
        var switch = $("#switch").data("kendoSwitch");

See Also

Other articles on Telerik UI for JSP and on the Switch:

In this article
Not finding the help you need? Improve this article