#if $block{isCheckSetListenersIfCode} function checkSetListenerUpdateContent(e, elem) { $block{checkSetListenersIfCode} { return true; } return false; } #endif function setListeners(e) { var that = this; require(["dijit/registry", "dojo/_base/lang", "dojo/query", "dojo/on", "dojo/ready"], function(registry, lang, query, on, ready) { ready(function() { // リストボックス query("[role|='listbox']").forEach(function(node) { var widget = registry.byId(node.id); if (widget && (!that.checkSetListenerUpdateContent || that.checkSetListenerUpdateContent(e, widget))) { widget.on("change", function(e) { updateContent(null, this.valueNode); }); } }); // テキストボックス、テキストエリア query("[data-dojo-attach-point|='textbox,focusNode'],textarea").forEach(function(node) { var widget = registry.byId(node.id); if (widget && (!that.checkSetListenerUpdateContent || that.checkSetListenerUpdateContent(e, widget))) { widget.on("change", function(e) { updateContent(null, this); }); } }); // ラジオボタン、チェックボックス query("[role|='radio'],[role|='checkbox']").forEach(function(node) { var widget = registry.byId(node.id); if (widget && (!that.checkSetListenerUpdateContent || that.checkSetListenerUpdateContent(e, widget))) { widget.on("click", function(e) { setTimeout(lang.hitch(this, function() { updateContent(null, this); }), 10); }); } }); }); }); }