<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
<link rel="stylesheet" href="resources/dijit/themes/claro/claro.css">
<script>dojoConfig = {parseOnLoad: true}</script>
<script src='resources/dojo/dojo.js'></script>
<script>
require(["dojo/parser", "dijit/form/Button"]);
</script>
<script>
require(["dojo/parser", "dojo/_base/connect", "dijit/registry", "dijit/form/Button"],
function(parser, connect, registry){
parser.parse();
var toggled = false;
registry.byId("toggleButton").connect("onClick", function toggle(){
this.set("iconClass", toggled ? "dijitEditorIcon dijitEditorIconCut" : "dijitEditorIcon dijitEditorIconPaste");
toggled = !toggled;
});
});
</script>
</head>
<body>
<button data-dojo-type="dijit/form/Button" id="toggleButton" data-dojo-id="myToggleButton" data-dojo-props="iconClass:'dijitEditorIcon dijitEditorIconCut'" type="button">
Click me!
</button>
</body>
</html> |