/*
	Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.wire.ml.Action"],["provide","dojox.wire.ml.ActionFilter"],["require","dijit._Widget"],["require","dijit._Container"],["require","dojox.wire.Wire"],["require","dojox.wire.ml.util"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.wire.ml.Action"]){_4._hasResource["dojox.wire.ml.Action"]=true;_4.provide("dojox.wire.ml.Action");_4.provide("dojox.wire.ml.ActionFilter");_4.require("dijit._Widget");_4.require("dijit._Container");_4.require("dojox.wire.Wire");_4.require("dojox.wire.ml.util");_4.declare("dojox.wire.ml.Action",[_5._Widget,_5._Container],{trigger:"",triggerEvent:"",triggerTopic:"",postCreate:function(){this._connect();},_connect:function(){if(this.triggerEvent){if(this.trigger){var _7=_6.wire.ml._getValue(this.trigger);if(_7){if(!_7[this.triggerEvent]){_7[this.triggerEvent]=function(){};}this._triggerHandle=_4.connect(_7,this.triggerEvent,this,"run");}}else{var _8=this.triggerEvent.toLowerCase();if(_8=="onload"){var _9=this;_4.addOnLoad(function(){_9._run.apply(_9,arguments);});}}}else{if(this.triggerTopic){this._triggerHandle=_4.subscribe(this.triggerTopic,this,"run");}}},_disconnect:function(){if(this._triggerHandle){if(this.triggerTopic){_4.unsubscribe(this.triggerTopic,this._triggerHandle);}else{_4.disconnect(this._triggerHandle);}}},run:function(){var _a=this.getChildren();for(var i in _a){var _b=_a[i];if(_b instanceof _6.wire.ml.ActionFilter){if(!_b.filter.apply(_b,arguments)){return;}}}this._run.apply(this,arguments);},_run:function(){var _c=this.getChildren();for(var i in _c){var _d=_c[i];if(_d instanceof _6.wire.ml.Action){_d.run.apply(_d,arguments);}}},uninitialize:function(){this._disconnect();return true;}});_4.declare("dojox.wire.ml.ActionFilter",_5._Widget,{required:"",requiredValue:"",type:"",message:"",error:"",filter:function(){if(this.required===""){return true;}else{var _e=_6.wire.ml._getValue(this.required,arguments);if(this.requiredValue===""){if(_e){return true;}}else{var _f=this.requiredValue;if(this.type!==""){var _10=this.type.toLowerCase();if(_10==="boolean"){if(_f.toLowerCase()==="false"){_f=false;}else{_f=true;}}else{if(_10==="number"){_f=parseInt(_f,10);}}}if(_e===_f){return true;}}}if(this.message){if(this.error){_6.wire.ml._setValue(this.error,this.message);}else{alert(this.message);}}return false;}});}}};});