Esempio n. 1
0
 public function getCallbackReference(ICallbackEventHandler $callbackHandler, $options = null)
 {
     $options = !is_array($options) ? array() : $options;
     $class = new ReflectionClass($callbackHandler);
     $clientSide = $callbackHandler->getActiveControl()->getClientSide();
     $options = array_merge($options, $clientSide->getOptions()->toArray());
     $optionString = TJavaScript::encode($options);
     $this->registerPradoScriptInternal('ajax');
     $id = $callbackHandler->getUniqueID();
     return "new Prado.CallbackRequest('{$id}',{$optionString})";
 }
 /**
  * Register controls that can handle callbacks. Controls that implement
  * ICallbackEventHandler are automatically added during component
  * registration.
  * @param ICallbackEventHandler a control that can handle callback.
  */
 public function registerCallbackCandidate(ICallbackEventHandler $control)
 {
     $this->callbacksCandidates[$control->getUniqueID()] = $control;
 }