public function executeFormUpdateRequest(WebRequest $request, Response $response, Form $form)
    {
        $responseData = array('csrf' => $form->generateCsrfToken($request));
        
        // If the search param not set return with an empty response
        if (!$request->hasParam('form-extended-entity-select-query')) {
            $responseData['data'] = array();
            $response->setOutput(json_encode($responseData), true);
            return;
        }
        
        $query = $request->getParam('form-extended-entity-select-query');
        $entities = $this->getAvailableValues($query);
        
        if ($entities === false) {
            $response->setOutput(json_encode(array('error' => true)), true);
            return;
        }
        
        $data = array();
        foreach ($entities as $entity) {
            $data[] = array('id' => $entity->getId(), 'name' => (string) $entity);
        }
        
        $responseData['data'] = $data;
        
        $response->setOutput(json_encode($responseData), true);
    }