Bonjour alors voilà j'ai suivi ce tuto pour pouvoir faire de l'autocomplétion mais rien autocompletion ne marche pas il ne ce passe rien quand je tape dans la zone de saisie.
En allant sur recherche/userlist j'ai bien mais données qui s'affiche correctement.

Voici mon code.
rechercheController
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/**
 * Index controller
 *
 * Default controller for this application.
 * 
 * @uses	   Zend_Controller_Action
 * @package	QuickStart
 * @subpackage Controller
 */
class RechercheController extends Zend_Controller_Action {
	/**
	 * The "index" action is the default action for all controllers -- the
	 * landing page of the site.
	 *
	 * Assuming the default route and default router, this action is dispatched
	 * via the following urls:
	 * - /
	 * - /index/
	 * - /index/index
	 *
	 * @return void
	 */
	public function indexAction() {
	$form = $this->getForm();
 
        if ($this->_request->isPost()) {
 
            if ($form->isValid($_POST)) {
                /*
                 * Process data
                 */
                $userId = $this->_getParam('userId');
                //$userId contains the userId input by the user
            } else {
               $form->populate($_POST);
 
               $this->view->form = $form;
            }
 
        } else {
 
           $this->view->form = $form;
        }
	}
 
	function userlistAction() {
 
		$dbUtilisateur = new Model_DbTable_Utilisateur();
		$result = $dbUtilisateur->getDefaultAdapter()->fetchAll("SELECT * FROM utilisateur");
        $data = new Zend_Dojo_Data('id', $result);
        echo $data->toJson();
		exit;
	}
 
	function getForm() {
		$form = new Zend_Form;
 
 $userId = new Zend_Dojo_Form_Element_FilteringSelect('userId');
 $userId->setLabel('Taper le nom recherche')
            ->setAutoComplete(true)
            ->setStoreId('userStore')
            ->setStoreType('dojo.data.ItemFileReadStore')
            ->setStoreParams(array('url' => 'userlist'))
            ->setAttrib("searchAttr", "nom_prenom")
            ->setRequired(true);
 
 $submit = $form->createElement('submit', 'submit');
 
 $form->addElements(array($userId, $submit));
 
 return $form;
	}
}

boostratp
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
/**
 * Application bootstrap
 * 
 * @uses	Zend_Application_Bootstrap_Bootstrap
 * @package QuickStart
 */
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
	public function run() {
		// Cela permet d'avoir la configuration disponible de partout dans notre application
		Zend_Registry::set('config', new Zend_Config($this->getOptions()));
		parent::run();
	}
 
	/**
	 * Bootstrap autoloader for application resources
	 *
	 * @return Zend_Application_Module_Autoloader
	 */
	protected function _initAutoload() {
		$autoloader = new Zend_Application_Module_Autoloader(array(
			'namespace' => '',
			'basePath'  => APPLICATION_PATH,
		));
		return $autoloader;
	}
 
	protected function _initSession() {
		// On initialise la session
		$session = new Zend_Session_Namespace('test_zend', true);
		return $session;
	}
 
	protected function _initView() {
		// Initialisation de la vue et des helpers de vue
		$view = new Zend_View();
		Zend_Dojo::enableView($view);
        $view->dojo()
		     ->addStyleSheetModule('dijit.themes.tundra')
    	     ->setDjConfigOption('usePlainJson', true)
    	     ->enable();
				// On ajoute le dossier des helpers
		$view->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper');
				// On charge l'helper qui va se charger de la vue
		$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
		$viewRenderer->setView($view);
		return $view;
	}
 
	/**
	 * Bootstrap the view doctype
	 *
	 * @return void
	 */
	protected function _initDoctype() {
		$this->bootstrap('view');
		$view = $this->getResource('view');
		$view->doctype('XHTML1_STRICT');
	}
}

layout
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php echo $this->doctype() ?> <!-- This Line will output the doctype we set inside the bootstrap file -->
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head>  
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
  <title> Projet de test du Framework ZEND !</title>
  <!--
      The line below demonstrates usage of the headLink() view helper
      @see http://framework.zend.com/manual/en/zend.view.helpers.html
      -->
  <?php echo $this->headLink()->appendStylesheet('/css/global.css') ?>
  <?php echo $this->dojo();
echo $this->dojo()->addStylesheetModule('dijit.themes.tundra');
?>
</head>
<body>
<div id="welcome">
	<center style="font-size: 20pt;">
	Projet de test du <span id="zf-name" style="font-size: 40pt;">Framework ZEND !</span>
	</center>
</div>
	<h1><?php echo $this->title; ?></h1>
 
<!-- This next call will now include any content that was generated in the
     dispatching of a controllers action (or series of actions).  -->
<?php echo $this->layout()->content ?>
 
 
 
<!-- if your application requires it, this would be a great place to put a
     footer for all pages. -->
</body>
</html>

j'ai essayer plusieurs solution comme mettre url a recherche/userlist .
Jouer avec le layout que j'ai pu trouver sur différent post.

Mis le code proposer en fion d'article pour la version 1.9.


En vous remerciant et bonne journée.