From 0d682e512ad1d07434320ace888c88511fb8426b Mon Sep 17 00:00:00 2001 From: xue <> Date: Fri, 28 Sep 2007 02:01:43 +0000 Subject: Fix prompt selection behavior. --- framework/Web/UI/WebControls/TListControl.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'framework/Web/UI/WebControls/TListControl.php') diff --git a/framework/Web/UI/WebControls/TListControl.php b/framework/Web/UI/WebControls/TListControl.php index 6e478550..785bd194 100644 --- a/framework/Web/UI/WebControls/TListControl.php +++ b/framework/Web/UI/WebControls/TListControl.php @@ -704,7 +704,7 @@ abstract class TListControl extends TDataBoundControl implements IDataRenderer } /** - * @return string the prompt text which is to be displayed as the first list item. Defaults to empty, meaning no prompt. + * @return string the prompt text which is to be displayed as the first list item. * @since 3.1.1 */ public function getPromptText() @@ -713,7 +713,7 @@ abstract class TListControl extends TDataBoundControl implements IDataRenderer } /** - * @param string the prompt text which is to be displayed as the first list item. If empty, {@link getPromptValue PromptValue} will be displayed. + * @param string the prompt text which is to be displayed as the first list item. * @since 3.1.1 */ public function setPromptText($value) @@ -722,7 +722,7 @@ abstract class TListControl extends TDataBoundControl implements IDataRenderer } /** - * @return string the prompt selection value. Defaults to empty, meaning no prompt. + * @return string the prompt selection value. * @see getPromptText * @since 3.1.1 */ @@ -773,11 +773,9 @@ abstract class TListControl extends TDataBoundControl implements IDataRenderer { $text=$this->getPromptText(); $value=$this->getPromptValue(); - if($text==='') - $text=$value; if($value==='') $value=$text; - if($text!=='') + if($value!=='') { $writer->addAttribute('value',$value); $writer->renderBeginTag('option'); -- cgit v1.2.3