diff options
author | xue <> | 2005-12-16 15:26:52 +0000 |
---|---|---|
committer | xue <> | 2005-12-16 15:26:52 +0000 |
commit | 16a21c1b65deebae478ef7b8dbea8db689f456c1 (patch) | |
tree | 5a37c561f46678b356125d94249a4d0a7ee37830 | |
parent | 47ef532b8fca6e9b8935c97aaae3253672b8455e (diff) |
Split dataBind() into dataBindProperties() and dataBindChildren().
-rw-r--r-- | framework/Web/UI/TControl.php | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php index e84f2f5b..5c3eecc6 100644 --- a/framework/Web/UI/TControl.php +++ b/framework/Web/UI/TControl.php @@ -727,22 +727,35 @@ class TControl extends TComponent }
/**
- * Performs the databinding for this component.
- * Databinding a property includes evaluating the binded expression
- * and setting the property with the evaluation result.
+ * Performs the databinding for this control.
* @param boolean whether to raise DataBinding event.
- * @throws TInvalidOperationException if some bounded property is invalid
- * @throws TExpressionInvalidException if some bounded expression is invalid
*/
public function dataBind($raiseDataBindingEvent=true)
{
+ $this->dataBindProperties($raiseDataBindingEvent);
+ if($raiseDataBindingEvent)
+ $this->onDataBinding(null);
+ $this->dataBindChildren($raiseDataBindingEvent);
+ }
+
+ /**
+ * Databinding properties of the control.
+ */
+ protected function dataBindProperties()
+ {
if(isset($this->_rf[self::RF_DATA_BINDINGS]))
{
foreach($this->_rf[self::RF_DATA_BINDINGS] as $property=>$expression)
$this->setSubProperty($property,$this->evaluateExpression($expression));
- if($raiseDataBindingEvent)
- $this->onDataBinding(null);
}
+ }
+
+ /**
+ * Databinding child controls.
+ * @param boolean whether to raise DataBinding event.
+ */
+ protected function dataBindChildren($raiseDataBindingEvent)
+ {
if(isset($this->_rf[self::RF_CONTROLS]))
{
foreach($this->_rf[self::RF_CONTROLS] as $control)
|