/* Copyright (c) 2004-2006, The Dojo Foundation All Rights Reserved. Licensed under the Academic Free License version 2.1 or above OR the modified BSD license. For more information on Dojo licensing, see: http://dojotoolkit.org/community/licensing.shtml */ dojo.provide("dojo.widget.Form"); dojo.require("dojo.widget.*"); dojo.require("dojo.widget.HtmlWidget"); dojo.widget.defineWidget("dojo.widget.Form", dojo.widget.HtmlWidget, { /* summary: Widget for easily moving data to/from form description: gets and sets data to and from js-object. With this it's easy to create forms to application. Just create empty form, then set it's values with this and after user pushes submit, getValues and send them as json-notation to server. Note: not all Form widgets are supported ATM usage:
myObj={name: "John Doe"}; dojo.widget.byId('myForm').setValues(myObj); myObj=dojo.widget.byId('myForm').getValues(); */ isContainer: true, templateString: "", formElements: [], // ignoreNullValue: // if true, then only fields that has data is set to form // if false, fields that does not have corresponding object, is set to empty ignoreNullValues: false, postCreate: function(args,frag){ for (var key in args) { if (key == "dojotype") continue; var attr= document.createAttribute(key); attr.nodeValue=args[key]; this.containerNode.setAttributeNode(attr); } }, _createRepeaters: function (/*object*/obj, /*widget*/widget) { for(var i=0; i