4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-form-field-Hidden'>/**
19 </span> * A basic hidden field for storing hidden values in forms that need to be passed in the form submit.
21 * This creates an actual input element with type="submit" in the DOM. While its label is
22 * {@link #hideLabel not rendered} by default, it is still a real component and may be sized according
23 * to its owner container's layout.
25 * Because of this, in most cases it is more convenient and less problematic to simply
26 * {@link Ext.form.action.Action#params pass hidden parameters} directly when
27 * {@link Ext.form.Basic#submit submitting the form}.
31 * new Ext.form.Panel({
35 * fieldLabel: 'Text Field',
37 * value: 'value from text field'
39 * xtype: 'hiddenfield',
40 * name: 'hidden_field_1',
41 * value: 'value from hidden field'
46 * handler: function() {
47 * this.up('form').getForm().submit({
49 * hidden_field_2: 'value from submit call'
56 * Submitting the above form will result in three values sent to the server:
58 * text_field=value+from+text+field&hidden;_field_1=value+from+hidden+field&hidden_field_2=value+from+submit+call
61 Ext.define('Ext.form.field.Hidden', {
62 extend:'Ext.form.field.Base',
63 alias: ['widget.hiddenfield', 'widget.hidden'],
64 alternateClassName: 'Ext.form.Hidden',
70 initComponent: function(){
71 this.formItemCls += '-hidden';
75 <span id='Ext-form-field-Hidden-method-isEqual'> /**
77 * Override. Treat undefined and null values as equal to an empty string value.
79 isEqual: function(value1, value2) {
80 return this.isEqualAsString(value1, value2);
83 // These are all private overrides
84 initEvents: Ext.emptyFn,
85 setSize : Ext.emptyFn,
86 setWidth : Ext.emptyFn,
87 setHeight : Ext.emptyFn,
88 setPosition : Ext.emptyFn,
89 setPagePosition : Ext.emptyFn,
90 markInvalid : Ext.emptyFn,
91 clearInvalid : Ext.emptyFn