private function _getComponentSetupCommands(__IComponent &$component)
 {
     $return_value = array();
     //update client end-point with current component state:
     $component->updateClient();
     //get all commands from client end-points
     $binding_codes = $component->getBindingCodes();
     foreach ($binding_codes as $binding_code) {
         $ui_binding = __UIBindingManager::getInstance()->getUIBinding($binding_code);
         if ($ui_binding != null) {
             $command = $ui_binding->getClientEndPoint()->getSetupCommand();
             if ($command != null) {
                 $return_value[] = $command;
             }
         }
     }
     $handled_events = __EventHandlerManager::getInstance()->getEventHandler($component->getViewCode())->getComponentHandledEvents($component->getName());
     foreach ($handled_events as $handled_event) {
         if ($handled_event != 'submit') {
             $command = new __AsyncMessageCommand();
             $command->setClass('__RegisterEventListenerCommand');
             $command->setData(array('element' => $component->getId(), 'event' => $handled_event));
             $return_value[] = $command;
         }
     }
     return $return_value;
 }
 /**
  * Get a command representing the current end-point
  *
  * @return __AsyncMessageCommand
  */
 public function getCommand()
 {
     $return_value = null;
     $data = array();
     $data['message'] = $this->_message;
     $data['receiver'] = $this->_instance;
     $return_value = new __AsyncMessageCommand();
     $return_value->setClass('__ShowValidationErrorCommand');
     $return_value->setData($data);
     return $return_value;
 }
 public function getCommand()
 {
     $return_value = null;
     if ($this->isUnsynchronized() && ($this->_getter != null || $this->_setter != null)) {
         $data = array();
         $data['code'] = $this->getUIBinding()->getId();
         $data['value'] = $this->_value;
         $return_value = new __AsyncMessageCommand();
         $return_value->setClass('__UpdateValueHolderCommand');
         $return_value->setData($data);
         $this->setAsSynchronized();
     }
     return $return_value;
 }
 /**
  * Get the command representing the call to the client-side method and set the current end-point as synchronized
  *
  * @return __AsyncMessageCommand
  */
 public function getCommand()
 {
     $return_value = null;
     if ($this->_execute_always || $this->isUnsynchronized()) {
         $data = array();
         $data['parameter'] = $this->_value;
         $data['receiver'] = $this->_instance;
         $data['method'] = $this->_method;
         $return_value = new __AsyncMessageCommand();
         $return_value->setClass($this->getClientCommandClass());
         $return_value->setData($data);
         $this->setAsSynchronized();
     }
     return $return_value;
 }
 /**
  * Get a command representing the current end-point, just in case the client is unsynchronized
  *
  * @return __AsyncMessageCommand
  */
 public function getCommand()
 {
     $return_value = null;
     if ($this->isUnsynchronized()) {
         $data = array();
         $js_code = $this->_javascript_code;
         if ($this->_value !== null) {
             $js_code = str_replace('{value}', $this->_normalizeValue($this->_value), $js_code);
         }
         $data['code'] = $js_code;
         $return_value = new __AsyncMessageCommand();
         $return_value->setClass('__ExecuteJavascriptOnDemandCommand');
         $return_value->setData($data);
         $this->setAsSynchronized();
     }
     return $return_value;
 }
 public function getCommand()
 {
     $return_value = null;
     if ($this->isUnsynchronized()) {
         $parameter = $this->_normalizeValue($this->getValue());
         if (key_exists($parameter, $this->_mapping_callbacks)) {
             $data = array();
             $data['parameter'] = null;
             $data['receiver'] = $this->_instance;
             $data['method'] = $this->_mapping_callbacks[$parameter];
             $return_value = new __AsyncMessageCommand();
             $return_value->setClass($this->getClientCommandClass());
             $return_value->setData($data);
         }
         $this->setAsSynchronized();
     }
     return $return_value;
 }