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; }