diff options
author | xue <> | 2007-07-25 14:55:21 +0000 |
---|---|---|
committer | xue <> | 2007-07-25 14:55:21 +0000 |
commit | da9075fb882be335d425a4bc94bd59c1a9876056 (patch) | |
tree | 5184707368b74ecf15291bad8ffa516f52d72c4b /framework/Web | |
parent | 2116c42f90f674f62ef2d56e961ba9b7137b573d (diff) |
Added TTabPanel.
Diffstat (limited to 'framework/Web')
-rw-r--r-- | framework/Web/Javascripts/source/prado/controls/controls.js | 50 | ||||
-rw-r--r-- | framework/Web/UI/TClientScriptManager.php | 5 |
2 files changed, 52 insertions, 3 deletions
diff --git a/framework/Web/Javascripts/source/prado/controls/controls.js b/framework/Web/Javascripts/source/prado/controls/controls.js index 4ef824c2..e0f9218c 100644 --- a/framework/Web/Javascripts/source/prado/controls/controls.js +++ b/framework/Web/Javascripts/source/prado/controls/controls.js @@ -287,4 +287,52 @@ Prado.WebUI.TRadioButtonList = Base.extend( new Prado.WebUI.TRadioButton(radioButtonOptions);
}
}
-});
\ No newline at end of file +});
+
+Prado.WebUI.TTabPanel = Class.create();
+Prado.WebUI.TTabPanel.prototype =
+{
+ initialize : function(options)
+ {
+ this.element = $(options.ID);
+ this.onInit(options);
+ },
+
+ onInit : function(options)
+ {
+ this.views = options.Views;
+ this.hiddenField = $(options.ID+'_1');
+ this.activeCssClass = options.ActiveCssClass;
+ this.normalCssClass = options.NormalCssClass;
+ var length = options.Views.length;
+ for(var i = 0; i<length; i++)
+ {
+ var item = options.Views[i];
+ var element = $(item+'_0');
+ if (element)
+ {
+ Event.observe(element, "click", this.elementClicked.bindEvent(this,item));
+ }
+ }
+ },
+
+ elementClicked : function(event,viewID)
+ {
+ var length = this.views.length;
+ for(var i = 0; i<length; i++)
+ {
+ var item = this.views[i];
+ if(item == viewID)
+ {
+ $(item+'_0').className=this.activeCssClass;
+ $(item).show();
+ this.hiddenField.value=i;
+ }
+ else
+ {
+ $(item+'_0').className=this.normalCssClass;
+ $(item).hide();
+ }
+ }
+ }
+};
diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php index 5f924397..cd8826dc 100644 --- a/framework/Web/UI/TClientScriptManager.php +++ b/framework/Web/UI/TClientScriptManager.php @@ -605,14 +605,15 @@ class TClientScriptManager extends TApplicationComponent $str=''; foreach($this->_hiddenFields as $name=>$value) { + $id=strtr($name,':','_'); if(is_array($value)) { foreach($value as $v) - $str.='<input type="hidden" name="'.$name.'[]" id="'.$name.'" value="'.THttpUtility::htmlEncode($value)."\" />\n"; + $str.='<input type="hidden" name="'.$name.'[]" id="'.$id.'" value="'.THttpUtility::htmlEncode($value)."\" />\n"; } else { - $str.='<input type="hidden" name="'.$name.'" id="'.$name.'" value="'.THttpUtility::htmlEncode($value)."\" />\n"; + $str.='<input type="hidden" name="'.$name.'" id="'.$id.'" value="'.THttpUtility::htmlEncode($value)."\" />\n"; } } if($str!=='') |