diff options
Diffstat (limited to 'framework/Web/UI')
-rw-r--r-- | framework/Web/UI/WebControls/TCheckBox.php | 2 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TListControl.php | 15 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TRadioButton.php | 2 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TTextBox.php | 24 |
4 files changed, 5 insertions, 38 deletions
diff --git a/framework/Web/UI/WebControls/TCheckBox.php b/framework/Web/UI/WebControls/TCheckBox.php index 0a628674..bc90a93b 100644 --- a/framework/Web/UI/WebControls/TCheckBox.php +++ b/framework/Web/UI/WebControls/TCheckBox.php @@ -356,7 +356,7 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl $writer->addAttribute('disabled','disabled');
$page=$this->getPage();
- if($this->getAutoPostBack() && $page->getClientSupportsJavaScript())
+ if($this->getEnabled(true) && $this->getAutoPostBack() && $page->getClientSupportsJavaScript())
$page->getClientScript()->registerPostBackControl($this);
if(($accesskey=$this->getAccessKey())!=='')
diff --git a/framework/Web/UI/WebControls/TListControl.php b/framework/Web/UI/WebControls/TListControl.php index cf254bad..2b40bfa8 100644 --- a/framework/Web/UI/WebControls/TListControl.php +++ b/framework/Web/UI/WebControls/TListControl.php @@ -106,14 +106,10 @@ abstract class TListControl extends TDataBoundControl $page->ensureRenderInForm($this);
if($this->getIsMultiSelect())
$writer->addAttribute('multiple','multiple');
- if($this->getAutoPostBack() && $page->getClientSupportsJavaScript())
+ if($this->getEnabled(true) && $this->getAutoPostBack() && $page->getClientSupportsJavaScript())
{
$writer->addAttribute('id',$this->getClientID());
$this->getPage()->getClientScript()->registerPostBackControl($this);
- /*$options = $this->getAutoPostBackOptions();
- $scripts = $this->getPage()->getClientScript();
- $postback = $scripts->getPostBackEventReference($this,'',$options,false);
- $scripts->registerClientEvent($this, "change", $postback);*/
}
if($this->getEnabled(true) && !$this->getEnabled())
$writer->addAttribute('disabled','disabled');
@@ -125,15 +121,6 @@ abstract class TListControl extends TDataBoundControl */
public function getPostBackOptions()
{
-/* $option=new TPostBackOptions();
- $group = $this->getValidationGroup();
- $hasValidators = $this->getPage()->getValidators($group)->getCount()>0;
- if($this->getCausesValidation() && $hasValidators)
- {
- $option->setPerformValidation(true);
- $option->setValidationGroup($group);
- }
- $option->setAutoPostBack(true);*/
$options['CausesValidation'] = $this->getCausesValidation();
$options['ValidationGroup'] = $this->getValidationGroup();
$options['EventTarget'] = $this->getUniqueID();
diff --git a/framework/Web/UI/WebControls/TRadioButton.php b/framework/Web/UI/WebControls/TRadioButton.php index a345f060..cb0454ae 100644 --- a/framework/Web/UI/WebControls/TRadioButton.php +++ b/framework/Web/UI/WebControls/TRadioButton.php @@ -145,7 +145,7 @@ class TRadioButton extends TCheckBox $writer->addAttribute('disabled','disabled');
$page=$this->getPage();
- if($this->getAutoPostBack() && $page->getClientSupportsJavaScript())
+ if($this->getEnabled(true) && $this->getAutoPostBack() && $page->getClientSupportsJavaScript())
$page->getClientScript()->registerPostBackControl($this);
if(($accesskey=$this->getAccessKey())!=='')
diff --git a/framework/Web/UI/WebControls/TTextBox.php b/framework/Web/UI/WebControls/TTextBox.php index af73de35..9427bb1f 100644 --- a/framework/Web/UI/WebControls/TTextBox.php +++ b/framework/Web/UI/WebControls/TTextBox.php @@ -141,21 +141,11 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable $writer->addAttribute('readonly','readonly');
if(!$this->getEnabled(true) && $this->getEnabled()) // in this case parent will not render 'disabled'
$writer->addAttribute('disabled','disabled');
- if($this->getAutoPostBack() && $page->getClientSupportsJavaScript())
+ if($this->getEnabled(true) && $this->getAutoPostBack() && $page->getClientSupportsJavaScript())
{
$writer->addAttribute('id',$this->getClientID());
$this->getPage()->getClientScript()->registerPostBackControl($this);
- /*$options = $this->getAutoPostBackOptions();
- $scripts = $this->getPage()->getClientScript();
- $postback = $scripts->getPostBackEventReference($this,'',$options,false);
- $scripts->registerClientEvent($this, "change", $postback);
- *
- if($this->getTextMode() !== 'MultiLine')
- {
- $code = "if(Prado.TextBox.handleReturnKey(e)==false) Event.stop(e);";
- $scripts->registerClientEvent($this, "keypress", $code);
- }*/
- }
+ }
parent::addAttributesToRender($writer);
}
@@ -170,16 +160,6 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable $options['ValidationGroup'] = $this->getValidationGroup();
$options['TextMode'] = $this->getTextMode();
return $options;
- /*
- $option=new TPostBackOptions();
- $group = $this->getValidationGroup();
- $hasValidators = $this->getPage()->getValidators($group)->getCount()>0;
- if($this->getCausesValidation() && $hasValidators)
- {
- $option->setPerformValidation(true);
- $option->setValidationGroup($group);
- }
- $option->setAutoPostBack(true);*/
}
/**
|