summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls
diff options
context:
space:
mode:
authorxue <>2006-06-11 22:01:52 +0000
committerxue <>2006-06-11 22:01:52 +0000
commitf30c38fcc9d6cdfa7aafa5078a58645192c11974 (patch)
tree51817c56b7295386e90fea5bf0f9fbd776a84bff /framework/Web/UI/WebControls
parent233ad780df391ed4af569929c30a1370d2b440ef (diff)
Prado js files are not rendered at the beginning of the form
Diffstat (limited to 'framework/Web/UI/WebControls')
-rw-r--r--framework/Web/UI/WebControls/TImageButton.php2
-rw-r--r--framework/Web/UI/WebControls/TImageMap.php12
-rw-r--r--framework/Web/UI/WebControls/TListControl.php14
3 files changed, 13 insertions, 15 deletions
diff --git a/framework/Web/UI/WebControls/TImageButton.php b/framework/Web/UI/WebControls/TImageButton.php
index df8ace43..f7f6408a 100644
--- a/framework/Web/UI/WebControls/TImageButton.php
+++ b/framework/Web/UI/WebControls/TImageButton.php
@@ -88,7 +88,7 @@ class TImageButton extends TImage implements IPostBackDataHandler, IPostBackEven
if(($uniqueID=$this->getUniqueID())!=='')
$writer->addAttribute('name',$uniqueID);
if($this->getEnabled(true))
- $this->renderClientControlScript($writer);
+ $this->renderClientControlScript($writer);
else if($this->getEnabled()) // in this case, parent will not render 'disabled'
$writer->addAttribute('disabled','disabled');
parent::addAttributesToRender($writer);
diff --git a/framework/Web/UI/WebControls/TImageMap.php b/framework/Web/UI/WebControls/TImageMap.php
index be7bfea9..b6acf39e 100644
--- a/framework/Web/UI/WebControls/TImageMap.php
+++ b/framework/Web/UI/WebControls/TImageMap.php
@@ -94,6 +94,7 @@ class TImageMap extends TImage implements IPostBackEventHandler
$i=0;
$options['EventTarget'] = $this->getUniqueID();
$options['StopEvent'] = true;
+ $cs=$this->getPage()->getClientScript();
foreach($hotspots as $hotspot)
{
if($hotspot->getHotSpotMode()==='NotSet')
@@ -109,7 +110,7 @@ class TImageMap extends TImage implements IPostBackEventHandler
$options['EventParameter']="$i";
$options['CausesValidation']=$hotspot->getCausesValidation();
$options['ValidationGroup']=$hotspot->getValidationGroup();
- $cs->renderClientControlScript($writer,$options);
+ $cs->registerPostBackControl('Prado.WebUI.TImageMap',$options);
}
$hotspot->render($writer);
$writer->writeLine();
@@ -120,15 +121,6 @@ class TImageMap extends TImage implements IPostBackEventHandler
}
/**
- * Renders the client-script code.
- */
- protected function renderClientControlScript($writer,$options)
- {
- $cs = $this->getPage()->getClientScript();
- $cs->registerPostBackControl('Prado.WebUI.TImageMap',$options);
- }
-
- /**
* Raises the postback event.
* This method is required by {@link IPostBackEventHandler} interface.
* This method is mainly used by framework and control developers.
diff --git a/framework/Web/UI/WebControls/TListControl.php b/framework/Web/UI/WebControls/TListControl.php
index 2c42c462..ccb400dc 100644
--- a/framework/Web/UI/WebControls/TListControl.php
+++ b/framework/Web/UI/WebControls/TListControl.php
@@ -116,10 +116,7 @@ abstract class TListControl extends TDataBoundControl
if($this->getEnabled(true))
{
if($this->getAutoPostBack() && $page->getClientSupportsJavaScript())
- {
- $writer->addAttribute('id',$this->getClientID());
- $this->getPage()->getClientScript()->registerPostBackControl($this->getClientClassName(),$this->getPostBackOptions());
- }
+ $this->renderClientControlScript($writer);
}
else if($this->getEnabled())
$writer->addAttribute('disabled','disabled');
@@ -127,6 +124,15 @@ abstract class TListControl extends TDataBoundControl
}
/**
+ * Renders the javascript for list control.
+ */
+ protected function renderClientControlScript($writer)
+ {
+ $writer->addAttribute('id',$this->getClientID());
+ $this->getPage()->getClientScript()->registerPostBackControl($this->getClientClassName(),$this->getPostBackOptions());
+ }
+
+ /**
* Gets the name of the javascript class responsible for performing postback for this control.
* This method overrides the parent implementation.
* @return string the javascript class name