<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>	&lt;p&gt;inputEx is built around the &lt;b&gt;Field&lt;/b&gt; class. It is an &lt;b&gt;abstract&lt;/b&gt; class (we &lt;i&gt;never&lt;/i&gt; instantiate it).&lt;br/&gt;
		 All the other field classes inherits directly or indirectly from this base class. (see diagram below)&lt;/p&gt;
&lt;p&gt;&lt;p&gt;&lt;u&gt;Warning:&lt;/u&gt; this diagram is not complete. See &lt;a href=&quot;treeview.html&quot;&gt;treeview&lt;/a&gt; for the full class diagram&lt;/p&gt;&lt;br /&gt;
	&lt;center&gt;&lt;br /&gt;
		&lt;img src=&quot;../images/inputEx-class-diagram.png&quot; /&gt;&lt;/p&gt;
&lt;/center&gt;
	&lt;p&gt;&lt;/p&gt;
&lt;h2&gt;Instantiating a Field / the &amp;#8220;type&amp;#8221; property :&lt;/h2&gt;
&lt;p&gt;&lt;p&gt;There are 3 ways to instantiate a Field :&lt;/p&gt;&lt;br /&gt;
  &lt;ul&gt;&lt;br /&gt;
		&lt;li&gt;Calling the class constructor (classic) :&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
	var field = new inputEx.StringField({name: 'test'});
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&lt;br /&gt;
	  &lt;li&gt;Using the inputEx function with the &amp;#8220;type&amp;#8221; construction:&lt;br /&gt; &lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
	var field = inputEx({ type: 'string', inputParams: {name: 'test'} });
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&lt;br/&gt;&lt;/p&gt;
		&lt;li&gt;Through a meta-field (see below)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;p&gt;The default &amp;#8220;type&amp;#8221; associations : (&lt;u&gt;Warning:&lt;/u&gt; this table is not complete, but each class follow the same naming conventions.)&lt;/p&gt;&lt;/p&gt;
&lt;style&gt;
&lt;p&gt;#associationTypes {&lt;br /&gt;
	margin-left: 40px;&lt;br /&gt;
}&lt;br /&gt;
#associationTypes td {&lt;br /&gt;
	width: 200px;&lt;br /&gt;
	padding: 2px;&lt;br /&gt;
}&lt;br /&gt;
#associationTypes tr.odd {&lt;br /&gt;
	background-color: #aaaaff;&lt;br /&gt;
}&lt;br /&gt;
#associationTypes th {&lt;br /&gt;
	font-weight: bold;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
	padding: 5px;&lt;br /&gt;
	background-color: white;&lt;br /&gt;
}&lt;/p&gt;
&lt;/style&gt;
&lt;table id=&quot;associationTypes&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
				&lt;th&gt;type string&lt;/th&gt;
				&lt;th&gt;class&lt;/th&gt;
				&lt;th&gt;loader module&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&quot;odd&quot;&gt;
				&lt;td&gt;boolean&lt;/td&gt;
				&lt;td&gt;inputEx.CheckBox&lt;/td&gt;
				&lt;td&gt;inputex-checkbox&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
				&lt;td&gt;color&lt;/td&gt;
				&lt;td&gt;inputEx.ColorField&lt;/td&gt;
				&lt;td&gt;inputex-colorfield&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;
				&lt;td&gt;date&lt;/td&gt;
				&lt;td&gt;inputEx.DateField&lt;/td&gt;
				&lt;td&gt;inputex-datefield&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
				&lt;td&gt;email&lt;/td&gt;
				&lt;td&gt;inputEx.EmailField&lt;/td&gt;
				&lt;td&gt;inputex-emailfield&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;
				&lt;td&gt;form&lt;/td&gt;
				&lt;td&gt;inputEx.Form&lt;/td&gt;
				&lt;td&gt;inputex-form&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
				&lt;td&gt;group&lt;/td&gt;
				&lt;td&gt;inputEx.Group&lt;/td&gt;
				&lt;td&gt;inputex-group&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;
				&lt;td&gt;hidden&lt;/td&gt;
				&lt;td&gt;inputEx.HiddenField&lt;/td&gt;
				&lt;td&gt;inputex-hiddenfield&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
				&lt;td&gt;html&lt;/td&gt;
				&lt;td&gt;inputEx.RTEField&lt;/td&gt;
				&lt;td&gt;inputex-rtefield&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;
				&lt;td&gt;inplaceedit&lt;/td&gt;
				&lt;td&gt;inputEx.InPlaceEdit&lt;/td&gt;
				&lt;td&gt;inputex-inplaceedit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
				&lt;td&gt;IPv4&lt;/td&gt;
				&lt;td&gt;inputEx.IPv4Field&lt;/td&gt;
				&lt;td&gt;inputex-ipv4field&lt;/td&gt;
&lt;/tr&gt;
			&lt;tr class=&quot;odd&quot;&gt;&lt;td&gt;list&lt;/td&gt;
				&lt;td&gt;inputEx.ListField&lt;/td&gt;
				&lt;td&gt;inputex-listfield&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;
				&lt;td&gt;password&lt;/td&gt;
				&lt;td&gt;inputEx.PasswordField&lt;/td&gt;
				&lt;td&gt;inputex-passwordfield&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
				&lt;td&gt;select&lt;/td&gt;
				&lt;td&gt;inputEx.SelectField&lt;/td&gt;
				&lt;td&gt;inputex-selectfield&lt;/td&gt;
&lt;/tr&gt;
			&lt;tr class=&quot;odd&quot;&gt;&lt;td&gt;string&lt;/td&gt;
				&lt;td&gt;inputEx.StringField&lt;/td&gt;
				&lt;td&gt;inputex-stringfield&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
				&lt;td&gt;text&lt;/td&gt;
				&lt;td&gt;inputEx.Textarea&lt;/td&gt;
				&lt;td&gt;inputex-textarea&lt;/td&gt;
&lt;/tr&gt;
			&lt;tr class=&quot;odd&quot;&gt;&lt;td&gt;type&lt;/td&gt;
				&lt;td&gt;inputEx.TypeField&lt;/td&gt;
				&lt;td&gt;inputex-typefield&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
				&lt;td&gt;uneditable&lt;/td&gt;
				&lt;td&gt;inputEx.UneditableField&lt;/td&gt;
				&lt;td&gt;inputex-uneditablefield&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;odd&quot;&gt;
				&lt;td&gt;url&lt;/td&gt;
				&lt;td&gt;inputEx.UrlField&lt;/td&gt;
				&lt;td&gt;inputex-urlfield&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;p&gt;To link a class with a &amp;#8220;type&amp;#8221;, we use :&lt;/p&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
	inputEx.registerType(inputEx.StringField, 'string');
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
	&lt;p&gt;&lt;/p&gt;
&lt;h2&gt;Meta-Fields :&lt;/h2&gt;
	&lt;p&gt;Some special fields called meta-fields take one or multiple &amp;#8220;type&amp;#8221; construction objects as configuration.&lt;/p&gt;
&lt;ul&gt;
		&lt;li&gt;&lt;b&gt;Group&lt;/b&gt;: A group of fields. It is itself a Field so it can be combined with any other field.&lt;/li&gt;
&lt;p&gt;&lt;li&gt;&lt;b&gt;Form&lt;/b&gt;: A group that provide ajax form capabilities.&lt;/li&gt;&lt;/p&gt;
		 &lt;li&gt;&lt;b&gt;List&lt;/b&gt;: list of any subfield.&lt;/li&gt;
&lt;p&gt;&lt;li&gt;&lt;b&gt;InPlaceEdit&lt;/b&gt;: Make any subfield inplace-editable.&lt;/li&gt;&lt;/p&gt;
 		 &lt;li&gt;&lt;b&gt;Typefield&lt;/b&gt;: A special field that returns a config object to create an instance through the inputEx.buildField function. We create a form for each Field class to define the parameters for the specified field.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;p&gt;&lt;/p&gt;&lt;/p&gt;
&lt;h2&gt;Insert a Field into the &lt;span class=&quot;caps&quot;&gt;DOM&lt;/span&gt; :&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
	var field = inputEx.FieldClass({...options...});
	parentEl.appendChild( field.getEl() );
	
	// or
	
	var field = inputEx.FieldClass({...options..., parentEl: parentEl});
	
	// or
		
	var field = inputEx.FieldClass({...options..., parentEl: 'parentElId'});
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;h2&gt;The &amp;#8220;updated&amp;#8221; event :&lt;/h2&gt;&lt;/p&gt;
&lt;p&gt;All the fields fire the same event when they are &amp;#8220;updated&amp;#8221;.&lt;/p&gt;
&lt;p&gt;To subscribe this event for a field, use : (see &lt;a href=&quot;http://developer.yahoo.com/yui/event/#customevent&quot; target=&quot;_new&quot;&gt;&lt;span class=&quot;caps&quot;&gt;YUI&lt;/span&gt; Custom Events&lt;/a&gt; for more informations)&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
	myField.updatedEvt.subscribe(function(e,value) {
		// value = new value returned by getValue
		...code here...
	}, scope, true);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This event is fired when you use a setValue on the field. If you want to disable this behaviour, pass &amp;#8220;false&amp;#8221; as second argument to the setValue and the event won&amp;#8217;t be fired.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
	// This setValue won't fire the updatedEvt
	myField.setValue(&quot;My Value&quot;, false);
&lt;/code&gt;&lt;/pre&gt;</body>
  <created-at type="datetime">2009-11-26T04:22:26-08:00</created-at>
  <id type="integer">192484</id>
  <permalink>overview</permalink>
  <repository-id type="integer">108752</repository-id>
  <title>Overview</title>
  <updated-at type="datetime">2009-04-21T05:52:52-07:00</updated-at>
  <user-id type="integer">39354</user-id>
</wiki>
