summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--demos/quickstart/protected/pages/ActiveControls/Samples/TActiveMultiView/Home.page4
-rw-r--r--framework/Web/UI/ActiveControls/TActiveMultiView.php6
-rw-r--r--framework/Web/UI/WebControls/TMultiView.php6
3 files changed, 9 insertions, 7 deletions
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveMultiView/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveMultiView/Home.page
index 557f439e..deaaa187 100644
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveMultiView/Home.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveMultiView/Home.page
@@ -9,7 +9,7 @@
<com:TActiveTextBox ID="Memo" />
<hr/>
<com:TActiveButton Text="View 2" CommandName="NextView" />
- <com:TActiveButton Text="View 3" CommandName="SwitchViewIndex" ActiveControl.CallbackParameter="2" />
+ <com:TActiveButton Text="View 3" CommandName="SwitchViewIndex" CommandParameter="2" />
</com:TView>
<com:TView>
<h2>View 2</h2>
@@ -29,7 +29,7 @@
<br/>
<com:TActiveLabel ID="Result2" />
<hr/>
- <com:TActiveButton Text="View 1" CommandName="SwitchViewID" ActiveControl.CallbackParameter="View1" />
+ <com:TActiveButton Text="View 1" CommandName="SwitchViewID" CommandParameter="View1" />
<com:TActiveButton Text="View 2" CommandName="PreviousView" />
</com:TView>
</com:TActiveMultiView>
diff --git a/framework/Web/UI/ActiveControls/TActiveMultiView.php b/framework/Web/UI/ActiveControls/TActiveMultiView.php
index 5040ef94..5729634b 100644
--- a/framework/Web/UI/ActiveControls/TActiveMultiView.php
+++ b/framework/Web/UI/ActiveControls/TActiveMultiView.php
@@ -92,8 +92,9 @@ class TActiveMultiView extends TMultiView implements IActiveControl
*/
public function setActiveViewIndex($value)
{
+ $old=parent::getActiveViewIndex();
parent::setActiveViewIndex($value);
- if($this->getActiveControl()->canUpdateClientSide())
+ if($this->getActiveControl()->canUpdateClientSide() && $old!=$value)
$this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter());
}
@@ -103,8 +104,9 @@ class TActiveMultiView extends TMultiView implements IActiveControl
*/
public function setActiveView($value)
{
+ $old=parent::getActiveView();
parent::setActiveView($value);
- if($this->getActiveControl()->canUpdateClientSide())
+ if($this->getActiveControl()->canUpdateClientSide() && $old!=$value)
$this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter());
}
}
diff --git a/framework/Web/UI/WebControls/TMultiView.php b/framework/Web/UI/WebControls/TMultiView.php
index e7f5c12b..d9b2fb6f 100644
--- a/framework/Web/UI/WebControls/TMultiView.php
+++ b/framework/Web/UI/WebControls/TMultiView.php
@@ -4,7 +4,7 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2011 PradoSoft
+ * @copyright Copyright &copy; 2005-2011 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.WebControls
@@ -229,14 +229,14 @@ class TMultiView extends TControl
$this->setActiveViewIndex($index-1);
return true;
case self::CMD_SWITCHVIEWID:
- $view=$this->findControl($param->getCommandParameter());
+ $view=$this->findControl($viewID=$param->getCommandParameter());
if($view!==null && $view->getParent()===$this)
{
$this->setActiveView($view);
return true;
}
else
- throw new TInvalidDataValueException('multiview_viewid_invalid');
+ throw new TInvalidDataValueException('multiview_viewid_invalid', $viewID);
case self::CMD_SWITCHVIEWINDEX:
$index=TPropertyValue::ensureInteger($param->getCommandParameter());
$this->setActiveViewIndex($index);