Changeset 1822

Show
Ignore:
Timestamp:
04/01/2007 08:26:38 PM (20 months ago)
Author:
xue
Message:

fixed the issue that Event handler specified via subproperty in template does not work

Location:
branches/3.0
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/3.0/HISTORY

    r1786 r1822  
    77BUG: Ticket#558 - TRadionButtonList generates a empty onclick attribute (Qiang) 
    88BUG: Ticket#573 - NumberFormat Bug (Wei) 
     9BUG: Event handler specified via subproperty in template does not work (Qiang) 
    910ENH: Ticket#367 - Change default extension for XLIFF files (Wei, changed to support .xlf extension). 
    1011ENH: Upgraded javascript library Prototype to version 1.5.0 (Wei) 
  • branches/3.0/framework/TComponent.php

    r1457 r1822  
    346346                                if(is_string($handler)) 
    347347                                { 
    348                                         call_user_func($handler,$sender,$param); 
     348                                        if(($pos=strrpos($handler,'.'))!==false) 
     349                                        { 
     350                                                $object=$this->getSubProperty(substr($handler,0,$pos)); 
     351                                                $method=substr($handler,$pos+1); 
     352                                                if(method_exists($object,$method)) 
     353                                                        $object->$method($sender,$param); 
     354                                                else 
     355                                                        throw new TInvalidDataValueException('component_eventhandler_invalid',get_class($this),$name); 
     356                                        } 
     357                                        else 
     358                                                call_user_func($handler,$sender,$param); 
    349359                                } 
    350360                                else if(is_callable($handler,true))