summaryrefslogtreecommitdiff
path: root/framework/Web/UI
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI')
-rw-r--r--framework/Web/UI/ActiveControls/TActiveLinkButton.php37
-rwxr-xr-xframework/Web/UI/ActiveControls/TDraggable.php40
-rwxr-xr-xframework/Web/UI/ActiveControls/TDropContainer.php37
-rw-r--r--framework/Web/UI/TClientScriptManager.php33
-rw-r--r--framework/Web/UI/WebControls/TButtonColumn.php7
-rw-r--r--framework/Web/UI/WebControls/TEmailAddressValidator.php17
-rw-r--r--framework/Web/UI/WebControls/THyperLink.php31
-rw-r--r--framework/Web/UI/WebControls/TListControl.php7
-rw-r--r--framework/Web/UI/WebControls/TRequiredFieldValidator.php24
-rw-r--r--framework/Web/UI/WebControls/TWizard.php34
10 files changed, 206 insertions, 61 deletions
diff --git a/framework/Web/UI/ActiveControls/TActiveLinkButton.php b/framework/Web/UI/ActiveControls/TActiveLinkButton.php
index b95dad88..d8a8ffcb 100644
--- a/framework/Web/UI/ActiveControls/TActiveLinkButton.php
+++ b/framework/Web/UI/ActiveControls/TActiveLinkButton.php
@@ -6,7 +6,7 @@
* @link http://www.pradosoft.com/
* @copyright Copyright © 2005-2013 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TActiveLinkButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TActiveLinkButton.php 3292 2013-05-31 08:51:42Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
@@ -29,7 +29,7 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
* will update the link text upon callback response completion.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Id: TActiveLinkButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TActiveLinkButton.php 3292 2013-05-31 08:51:42Z ctrlaltca $
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
@@ -118,9 +118,36 @@ class TActiveLinkButton extends TLinkButton implements IActiveControl, ICallback
{
parent::addAttributesToRender($writer);
$writer->addAttribute('id',$this->getClientID());
- $this->renderLinkButtonHref($writer);
- $this->getActiveControl()->registerCallbackClientScript(
- $this->getClientClassName(), $this->getPostBackOptions());
+
+ if($this->getEnabled(true))
+ {
+ $this->getActiveControl()->registerCallbackClientScript(
+ $this->getClientClassName(), $this->getPostBackOptions());
+ }
+ }
+
+ /**
+ * Ensures that the anchor is rendered correctly when its Enabled property
+ * changes in a callback
+ * @param bool enabled
+ */
+ public function setEnabled($value)
+ {
+ parent::setEnabled($value);
+ if($this->getActiveControl()->canUpdateClientSide())
+ {
+ if($this->getEnabled(true))
+ {
+ $nop = "javascript:;//".$this->getClientID();
+ $this->getPage()->getCallbackClient()->setAttribute($this, 'href', $nop);
+
+ $this->getActiveControl()->registerCallbackClientScript(
+ $this->getClientClassName(), $this->getPostBackOptions());
+
+ } else {
+ $this->getPage()->getCallbackClient()->setAttribute($this, 'href', false);
+ }
+ }
}
/**
diff --git a/framework/Web/UI/ActiveControls/TDraggable.php b/framework/Web/UI/ActiveControls/TDraggable.php
index 23687207..df92bec5 100755
--- a/framework/Web/UI/ActiveControls/TDraggable.php
+++ b/framework/Web/UI/ActiveControls/TDraggable.php
@@ -6,7 +6,27 @@
* @copyright Copyright &copy; 2008, PradoSoft
* @license http://www.pradosoft.com/license
* @package System.Web.UI.ActiveControls
- * @version $Id: TDraggable.php 3247 2013-01-07 21:38:18Z ctrlaltca $
+ * @version $Id: TDraggable.php 3285 2013-04-11 07:28:07Z ctrlaltca $
+ */
+
+/**
+ * TDraggable is a control which can be dragged
+ *
+ * This control will make "draggable" control.
+ * Properties :
+ *
+ * <b>{@link setGhosting Ghosting}</b> : If set to "Ghosting" or "True", the dragged element will be cloned, and the clone will be dragged.
+ * If set to "SuperGhosting", the element will be cloned, and attached to body, so it can be dragged outside of its parent.
+ * If set to "None" of "False" (default), the element itself is dragged
+ * <b>{@link setRevert Revert}</b>: Set to True if you want your dragged element to revert to its initial position if not dropped on a valid area.
+ * <b>{@link setConstraint Constraint}</b>: Set this to Horizontal or Vertical if you want to constraint your move in one direction.
+ * <b>{@link setHandle Handle}</b>:
+ *
+ * @author Christophe BOULAIN (Christophe.Boulain@gmail.com)
+ * @copyright Copyright &copy; 2008, PradoSoft
+ * @license http://www.pradosoft.com/license
+ * @package System.Web.UI.ActiveControls
+ * @version $Id: TDraggable.php 3285 2013-04-11 07:28:07Z ctrlaltca $
*/
class TDraggable extends TPanel
{
@@ -193,7 +213,21 @@ class TDraggable extends TPanel
* @copyright Copyright &copy; 2008, PradoSoft
* @license http://www.pradosoft.com/license
* @package System.Web.UI.ActiveControls
- * @version $Id: TDraggable.php 3247 2013-01-07 21:38:18Z ctrlaltca $
+ * @version $Id: TDraggable.php 3285 2013-04-11 07:28:07Z ctrlaltca $
+ */
+class TDraggableConstraint extends TEnumerable
+{
+ const None='None';
+ const Horizontal='Horizontal';
+ const Vertical='Vertical';
+}
+
+/**
+ * @author Christophe BOULAIN (Christophe.Boulain@gmail.com)
+ * @copyright Copyright &copy; 2008, PradoSoft
+ * @license http://www.pradosoft.com/license
+ * @package System.Web.UI.ActiveControls
+ * @version $Id: TDraggable.php 3285 2013-04-11 07:28:07Z ctrlaltca $
*/
class TDraggableGhostingOptions extends TEnumerable
{
@@ -207,7 +241,7 @@ class TDraggableGhostingOptions extends TEnumerable
* @copyright Copyright &copy; 2008, PradoSoft
* @license http://www.pradosoft.com/license
* @package System.Web.UI.ActiveControls
- * @version $Id: TDraggable.php 3247 2013-01-07 21:38:18Z ctrlaltca $
+ * @version $Id: TDraggable.php 3285 2013-04-11 07:28:07Z ctrlaltca $
*/
class TDraggableRevertOptions extends TEnumerable
{
diff --git a/framework/Web/UI/ActiveControls/TDropContainer.php b/framework/Web/UI/ActiveControls/TDropContainer.php
index e603adf9..43e8017c 100755
--- a/framework/Web/UI/ActiveControls/TDropContainer.php
+++ b/framework/Web/UI/ActiveControls/TDropContainer.php
@@ -7,7 +7,40 @@
* @license http://www.pradosoft.com/license
* @version $Id: TDropContainer.php 3159 2012-2013 PradoSoft
* @license http://www.pradosoft.com/license
- * @version $Id: TDropContainer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TDropContainer.php 3285 2013-04-11 07:28:07Z ctrlaltca $
+ * @package System.Web.UI.ActiveControls
+ */
+
+/**
+ * Load active control adapter.
+ */
+Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
+/**
+ * Load active panel.
+ */
+Prado::using('System.Web.UI.ActiveControls.TActivePanel');
+
+
+/**
+ * TDropContainer is a panel where TDraggable controls can be dropped.
+ * When a TDraggable component is dropped into a TDropContainer, the {@link OnDrop OnDrop} event is raised.
+ * The {@link TDropContainerEventParameter} param will contain the dropped control.
+ *
+ * Properties :
+ *
+ * <b>{@link setAcceptCssClass AcceptCssClass}</b> : a coma delimited classname of elements that the drop container can accept.
+ * <b>{@link setHoverCssClass HoverCssClass}</b>: CSS classname of the container when a draggable element hovers over the container.
+ *
+ * Events:
+ *
+ * <b>{@link OnDrop OnDrop}</b> : raised when a TDraggable control is dropped. The dropped control id is encapsulated in the event parameter,
+ * as well as mouse coordinates and key modifiers status
+ *
+ *
+ * @author Christophe BOULAIN (Christophe.Boulain@gmail.com)
+ * @copyright Copyright &copy; 2008, PradoSoft
+ * @license http://www.pradosoft.com/license
+ * @version $Id: TDropContainer.php 3285 2013-04-11 07:28:07Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHandler
@@ -225,7 +258,7 @@ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHan
* @author Christophe BOULAIN (Christophe.Boulain@ceram.fr)
* @copyright Copyright &copy; 2008, PradoSoft
* @license http://www.pradosoft.com/license
- * @version $Id: TDropContainer.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TDropContainer.php 3285 2013-04-11 07:28:07Z ctrlaltca $
* @package System.Web.UI.ActiveControls
*/
class TDropContainerEventParameter extends TEventParameter
diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php
index 8a7afdad..0cdf3e32 100644
--- a/framework/Web/UI/TClientScriptManager.php
+++ b/framework/Web/UI/TClientScriptManager.php
@@ -7,7 +7,7 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2013 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TClientScriptManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TClientScriptManager.php 3280 2013-03-13 20:19:30Z ctrlaltca $
* @package System.Web.UI
*/
@@ -18,7 +18,7 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Gabor Berczi <gabor.berczi@devworx.hu> (lazyload additions & progressive rendering)
- * @version $Id: TClientScriptManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TClientScriptManager.php 3280 2013-03-13 20:19:30Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -406,8 +406,14 @@ class TClientScriptManager extends TApplicationComponent
*/
public function getStyleSheetUrls()
{
-
- $stylesheets = array_values(array_merge($this->_styleSheetFiles, $this->_styleSheets));
+ $stylesheets = array_values(
+ array_merge(
+ array_map(
+ create_function('$e', 'return is_array($e) ? $e[0] : $e;'),
+ $this->_styleSheetFiles),
+ $this->_styleSheets
+ )
+ );
foreach(Prado::getApplication()->getAssetManager()->getPublished() as $path=>$url)
if (substr($url,strlen($url)-4)=='.css')
@@ -758,7 +764,7 @@ class TClientScriptManager extends TApplicationComponent
* between ActiveControls and validators.
*
* @author <weizhuo[at]gmail[dot]com>
- * @version $Id: TClientScriptManager.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TClientScriptManager.php 3280 2013-03-13 20:19:30Z ctrlaltca $
* @package System.Web.UI
* @since 3.0
*/
@@ -770,14 +776,6 @@ abstract class TClientSideOptions extends TComponent
private $_options;
/**
- * Constructor, initialize the options list.
- */
- public function __construct()
- {
- $this->_options = Prado::createComponent('System.Collections.TMap');
- }
-
- /**
* Adds on client-side event handler by wrapping the code within a
* javascript function block. If the code begins with "javascript:", the
* code is assumed to be a javascript function block rather than arbiturary
@@ -797,7 +795,10 @@ abstract class TClientSideOptions extends TComponent
*/
protected function getOption($name)
{
- return $this->_options->itemAt($name);
+ if ($this->_options)
+ return $this->_options->itemAt($name);
+ else
+ return null;
}
/**
@@ -806,7 +807,7 @@ abstract class TClientSideOptions extends TComponent
*/
protected function setOption($name, $value)
{
- $this->_options->add($name, $value);
+ $this->getOptions()->add($name, $value);
}
/**
@@ -814,6 +815,8 @@ abstract class TClientSideOptions extends TComponent
*/
public function getOptions()
{
+ if (!$this->_options)
+ $this->_options = Prado::createComponent('System.Collections.TMap');
return $this->_options;
}
diff --git a/framework/Web/UI/WebControls/TButtonColumn.php b/framework/Web/UI/WebControls/TButtonColumn.php
index 7a0484c3..258fecf2 100644
--- a/framework/Web/UI/WebControls/TButtonColumn.php
+++ b/framework/Web/UI/WebControls/TButtonColumn.php
@@ -6,7 +6,7 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2013 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TButtonColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TButtonColumn.php 3287 2013-04-30 10:10:16Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -31,7 +31,7 @@ Prado::using('System.Web.UI.WebControls.TImageButton');
* If {@link setDataTextFormatString DataTextFormatString} is not empty,
* the value will be formatted before rendering.
*
- * The buttons in the column can be set to display as hyperlinks or push buttons
+ * The buttons in the column can be set to display as hyperlinks, push buttons or images
* by setting the {@link setButtonType ButtonType} property.
* The {@link setCommandName CommandName} will assign its value to
* all button's <b>CommandName</b> property. The datagrid will capture
@@ -48,7 +48,7 @@ Prado::using('System.Web.UI.WebControls.TImageButton');
* datagrid cell is the first child.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TButtonColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TButtonColumn.php 3287 2013-04-30 10:10:16Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -237,6 +237,7 @@ class TButtonColumn extends TDataGridColumn
{
$button=new TImageButton;
$button->setImageUrl($this->getImageUrl());
+ $button->setToolTip($this->getText());
}
$button->setText($this->getText());
$button->setCommandName($this->getCommandName());
diff --git a/framework/Web/UI/WebControls/TEmailAddressValidator.php b/framework/Web/UI/WebControls/TEmailAddressValidator.php
index 3bfd3e7b..dffe912e 100644
--- a/framework/Web/UI/WebControls/TEmailAddressValidator.php
+++ b/framework/Web/UI/WebControls/TEmailAddressValidator.php
@@ -6,7 +6,7 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2013 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TEmailAddressValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TEmailAddressValidator.php 3283 2013-03-24 10:19:08Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -24,7 +24,7 @@ Prado::using('System.Web.UI.WebControls.TRegularExpressionValidator');
* checkdnsrr() is available in the installed PHP.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TEmailAddressValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TEmailAddressValidator.php 3283 2013-03-24 10:19:08Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -32,8 +32,9 @@ class TEmailAddressValidator extends TRegularExpressionValidator
{
/**
* Regular expression used to validate the email address
+ * @see http://www.regular-expressions.info/email.html
*/
- const EMAIL_REGEXP="\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*";
+ const EMAIL_REGEXP='[a-zA-Z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&\'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?';
/**
* Gets the name of the javascript class responsible for performing validation for this control.
@@ -60,10 +61,12 @@ class TEmailAddressValidator extends TRegularExpressionValidator
*/
public function evaluateIsValid()
{
- $valid=parent::evaluateIsValid();
+ $value=$this->getValidationValue($this->getValidationTarget());
+ $valid=$valid=is_string($value) && strlen($value)<=254 && parent::evaluateIsValid();
+
if($valid && $this->getCheckMXRecord() && function_exists('checkdnsrr'))
{
- if(($value=$this->getValidationValue($this->getValidationTarget()))!=='')
+ if($value!=='')
{
if(($pos=strpos($value,'@'))!==false)
{
@@ -82,7 +85,7 @@ class TEmailAddressValidator extends TRegularExpressionValidator
*/
public function getCheckMXRecord()
{
- return $this->getViewState('CheckMXRecord',true);
+ return $this->getViewState('CheckMXRecord',false);
}
/**
@@ -91,7 +94,7 @@ class TEmailAddressValidator extends TRegularExpressionValidator
*/
public function setCheckMXRecord($value)
{
- $this->setViewState('CheckMXRecord',TPropertyValue::ensureBoolean($value),true);
+ $this->setViewState('CheckMXRecord',TPropertyValue::ensureBoolean($value),false);
}
}
diff --git a/framework/Web/UI/WebControls/THyperLink.php b/framework/Web/UI/WebControls/THyperLink.php
index bc6c3642..56aa5391 100644
--- a/framework/Web/UI/WebControls/THyperLink.php
+++ b/framework/Web/UI/WebControls/THyperLink.php
@@ -6,7 +6,7 @@
* @link http://www.xisc.com/
* @copyright Copyright &copy; 2005-2013 PradoSoft
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
- * @version $Id: THyperLink.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: THyperLink.php 3286 2013-04-18 06:09:19Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -17,13 +17,16 @@
* via the {@link setNavigateUrl NavigateUrl} property, and link text is via
* the {@link setText Text} property. It is also possible to display an image
* by setting the {@link setImageUrl ImageUrl} property. In this case,
- * {@link getText Text} is displayed as the alternate text of the image.
+ * the alignment of the image displayed is set by the
+ * {@link setImageAlign ImageAlign} property and {@link getText Text} is
+ * displayed as the alternate text of the image.
+ *
* The link target is specified via the {@link setTarget Target} property.
* If both {@link getImageUrl ImageUrl} and {@link getText Text} are empty,
* the content enclosed within the control tag will be rendered.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: THyperLink.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: THyperLink.php 3286 2013-04-18 06:09:19Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -92,6 +95,8 @@ class THyperLink extends TWebControl implements IDataRenderer
$image->setToolTip($toolTip);
if(($text=$this->getText())!=='')
$image->setAlternateText($text);
+ if(($align=$this->getImageAlign())!=='')
+ $image->setImageAlign($align);
$image->setBorderWidth('0');
return $image;
}
@@ -114,6 +119,26 @@ class THyperLink extends TWebControl implements IDataRenderer
}
/**
+ * @return string the alignment of the image with respective to other elements on the page, defaults to empty.
+ */
+ public function getImageAlign()
+ {
+ return $this->getViewState('ImageAlign','');
+ }
+
+ /**
+ * Sets the alignment of the image with respective to other elements on the page.
+ * Possible values include: absbottom, absmiddle, baseline, bottom, left,
+ * middle, right, texttop, and top. If an empty string is passed in,
+ * imagealign attribute will not be rendered.
+ * @param string the alignment of the image
+ */
+ public function setImageAlign($value)
+ {
+ $this->setViewState('ImageAlign',$value,'');
+ }
+
+ /**
* @return string height of the image in the THyperLink
*/
public function getImageHeight()
diff --git a/framework/Web/UI/WebControls/TListControl.php b/framework/Web/UI/WebControls/TListControl.php
index 2cd430d6..f9fdd77f 100644
--- a/framework/Web/UI/WebControls/TListControl.php
+++ b/framework/Web/UI/WebControls/TListControl.php
@@ -8,7 +8,7 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2013 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TListControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TListControl.php 3288 2013-04-30 10:36:50Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -75,8 +75,11 @@ Prado::using('System.Util.TDataFieldAccessor');
* used to format how the item should be displayed. See {@link formatDataValue()}
* for an explanation of the format string.
*
+ * The {@link setPromptText PromptText} and {@link setPromptValue PromptValue} properties can
+ * be used to add a dummy list item that will be rendered first.
+ *
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TListControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TListControl.php 3288 2013-04-30 10:36:50Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
diff --git a/framework/Web/UI/WebControls/TRequiredFieldValidator.php b/framework/Web/UI/WebControls/TRequiredFieldValidator.php
index 8d370502..7a0bad8c 100644
--- a/framework/Web/UI/WebControls/TRequiredFieldValidator.php
+++ b/framework/Web/UI/WebControls/TRequiredFieldValidator.php
@@ -6,7 +6,7 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2013 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TRequiredFieldValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TRequiredFieldValidator.php 3288 2013-04-30 10:36:50Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -25,8 +25,11 @@ Prado::using('System.Web.UI.WebControls.TBaseValidator');
* Validation will also succeed if input is of TListControl type and the number
* of selected values different from the initial value is greater than zero.
*
+ * If the input is of TListControl type and has a {@link TListControl::setPromptValue PromptValue}
+ * set, it will be automatically considered as the validator's {@link setInitialValue InitialValue}.
+ *
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TRequiredFieldValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TRequiredFieldValidator.php 3288 2013-04-30 10:36:50Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -43,16 +46,29 @@ class TRequiredFieldValidator extends TBaseValidator
}
/**
- * @return string the initial value of the associated input control. Defaults to empty string.
+ * @return string the initial value of the associated input control. Defaults to empty string
+ * unless the control has a prompt value set.
* If the associated input control does not change from this initial value
* upon postback, the validation fails.
*/
public function getInitialValue()
{
- return $this->getViewState('InitialValue','');
+ return $this->getViewState('InitialValue',$this->getControlPromptValue());
}
/**
+ * @return string the initial value of the associated input control. Defaults to empty string.
+ * If the associated input control does not change from this initial value
+ * upon postback, the validation fails.
+ */
+ protected function getControlPromptValue()
+ {
+ $control = $this->getValidationTarget();
+ if($control instanceof TListControl)
+ return $control->getPromptValue();
+ return '';
+ }
+ /**
* @param string the initial value of the associated input control.
* If the associated input control does not change from this initial value
* upon postback, the validation fails.
diff --git a/framework/Web/UI/WebControls/TWizard.php b/framework/Web/UI/WebControls/TWizard.php
index c29cb90c..67cbc4e4 100644
--- a/framework/Web/UI/WebControls/TWizard.php
+++ b/framework/Web/UI/WebControls/TWizard.php
@@ -6,7 +6,7 @@
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2013 PradoSoft
* @license http://www.pradosoft.com/license/
- * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
*/
@@ -77,7 +77,7 @@ Prado::using('System.Web.UI.WebControls.TWizardNavigationButtonStyle');
* - side bar: {@link getSideBarStyle SideBarStyle} and {@link getSideBarButtonStyle SideBarButtonStyle}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -284,7 +284,6 @@ class TWizard extends TWebControl implements INamingContainer
public function setShowSideBar($value)
{
$this->setViewState('ShowSideBar',TPropertyValue::ensureBoolean($value),true);
- $this->requiresControlsRecreation();
}
/**
@@ -772,6 +771,7 @@ class TWizard extends TWebControl implements INamingContainer
{
parent::onInit($param);
$this->ensureChildControls();
+ $this->setEnsureId(true);
if($this->getActiveStepIndex()<0 && $this->getWizardSteps()->getCount()>0)
$this->setActiveStepIndex(0);
}
@@ -1449,7 +1449,7 @@ class TWizard extends TWebControl implements INamingContainer
* set {@link setAllowReturn AllowReturn} to true.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1539,7 +1539,7 @@ class TWizardStep extends TView
* TCompleteWizardStep represents a wizard step of type TWizardStepType::Complete.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1574,7 +1574,7 @@ class TCompleteWizardStep extends TWizardStep
* if the navigation template is not specified, default navigation will be used.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1676,7 +1676,7 @@ class TTemplatedWizardStep extends TWizardStep implements INamingContainer
* by a {@link TWizard}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1740,7 +1740,7 @@ class TWizardStepCollection extends TList
* {@link getCancelButton CancelButton}, {@link getCompleteButton CompleteButton}.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1832,7 +1832,7 @@ class TWizardNavigationContainer extends TControl implements INamingContainer
* to true.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1897,7 +1897,7 @@ class TWizardNavigationEventParameter extends TEventParameter
* TWizardSideBarTemplate class.
* TWizardSideBarTemplate is the default template for wizard sidebar.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1922,7 +1922,7 @@ class TWizardSideBarTemplate extends TComponent implements ITemplate
* TWizardSideBarListItemTemplate class.
* TWizardSideBarListItemTemplate is the default template for each item in the sidebar datalist.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -1945,7 +1945,7 @@ class TWizardSideBarListItemTemplate extends TComponent implements ITemplate
* TWizardNavigationTemplate class.
* TWizardNavigationTemplate is the base class for various navigation templates.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -2017,7 +2017,7 @@ class TWizardNavigationTemplate extends TComponent implements ITemplate
* TWizardStartNavigationTemplate is the template used as default wizard start navigation panel.
* It consists of two buttons, Next and Cancel.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -2047,7 +2047,7 @@ class TWizardStartNavigationTemplate extends TWizardNavigationTemplate
* TWizardFinishNavigationTemplate is the template used as default wizard finish navigation panel.
* It consists of three buttons, Previous, Complete and Cancel.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -2081,7 +2081,7 @@ class TWizardFinishNavigationTemplate extends TWizardNavigationTemplate
* TWizardStepNavigationTemplate is the template used as default wizard step navigation panel.
* It consists of three buttons, Previous, Next and Cancel.
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0
*/
@@ -2122,7 +2122,7 @@ class TWizardStepNavigationTemplate extends TWizardNavigationTemplate
* - Link: a hyperlink button
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/
@@ -2146,7 +2146,7 @@ class TWizardNavigationButtonType extends TEnumerable
* - Finish: the last step before the Complete step.
*
* @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $
+ * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $
* @package System.Web.UI.WebControls
* @since 3.0.4
*/