Hi Everyone,

I am trying to implement autocomplete feature for University field in one
form. 

Here is the code for creating a field in the form :

            $university = new
Zend_Dojo_Form_Element_FilteringSelect('education_university');
            $university->setLabel('University ')
                       ->setAutoComplete(true)
                       ->setStoreId('university')
                       ->setStoreType('dojo.data.ItemFileReadStore')
                      
->setStoreParams(array('url'=>'/user/management/get-University-List'))
                       ->setAttrib("searchAttr", "university_name")
                       ->setRequired(true);
            $this->addElement($university);

Here is the code in the phtml file :

<div dojoType="dijit.form.FilteringSelect" jsId="university" 
url="/user/management/get-University-List" requestMethod="get">
<?= $this->form->education_university ?>
</div>

Here is the code for action :

        function getUniversityListAction()
        {       
                require_once 'user/models/University.php';
                $universityModel = new Model_University();
                $result = $universityModel->fetchUniversityNames();
               $dojoData = new Zend_Dojo_Data('university_id', $result);
               $this->_helper->autoCompleteDojo($dojoData);
        }

If I type any letter in the field, a small popup with the message "The value
entered is not valid" shows up. At the beginning of the action if I add code
to write some text in the log file to make sure that the action is being
called and type something in the University field, that text does not show
up in the log file. That means the action is not getting called. Does
anybody has any idea why the action is not getting called when I type
something in the field?

Thanks in advance.
 
-- 
View this message in context: 
http://www.nabble.com/Trying-to-implement-autocomplete-using-Zend_Dojo-tp25050694p25050694.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to