[Dojo-interest] best practice for doing a post in a custom widget?

computerbum robasc33 at yahoo.com
Wed Jan 29 12:22:22 EST 2014

Hello all,

So I built a widget named "Login" using the new amd loader. I am trying to
figure out the best way validate a user by sending the data to the server.
What is the best way to handle this situation?

		 function(declare, lang, arrayUtil, on, domConstruct, _WidgetBase,
				_TemplatedMixin, _WidgetsInTemplateMixin, template) {

			return declare([ _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin ],

				templateString : template,

				title : "Please Login",

				postMixInProperties : function() {


				postCreate : function() {

	                    on(this.submitButton, "click", lang.hitch(this,


                _validateUser: function() {

                        // do a post and on return validation object in
order to allow access 


// TEMPLATE Login.html
<div class="Login">

   <label for="userName">UserName: </label>
   <input data-dojo-type="dijit/form/TextBox" type="text" 
          data-dojo-attach-point="userName" >
   <label for="password">Password: </label>
   <input data-dojo-type="dijit/form/TextBox" type="password" 
          data-dojo-attach-point="password" >

   <button data-dojo-type="dijit/form/Button" type="button"

// index.html
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<link rel="stylesheet" href="custom/resources/css/Login.css">
<body class="claro">
  <div id="loginNode"></div>


View this message in context: http://dojo-toolkit.33424.n3.nabble.com/best-practice-for-doing-a-post-in-a-custom-widget-tp4000897.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.

More information about the Dojo-interest mailing list