ZF-6148: Dijit parsing before store creation results in FilteringSelect and ComboBox.

Issue Type: Bug Created: 2009-03-27T20:46:45.000+0000 Last Updated: 2009-07-14T07:58:40.000+0000 Status: Resolved Fix version(s): - 1.8.4 (23/Jun/09)

Reporter: Denis Baklikov (denis.baklikov) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Dojo

Related issues: Attachments:


This issue duplicates #5987.

I have got JavaScript error: ' is undefined' after migrating to ZF 1.7.7. It seems that JavaScript tried to create new instance of, but it is not loaded yet.

ItemFileReadStore instance should be created after page load, using dojo.addOnLoad method. I think that using prependOnLoad (look at the first comment) instead of addJavascript (in ComboBox.php line 142).

The following code was generated by Dojo View helper:

<pre class="highlight">

dojo.addOnLoad(function() {
dojo.forEach(zendDijits, function(info) {
var n = dojo.byId(;
if (null != n) {
dojo.attr(n, dojo.mixin({ id: }, info.params));

var manufacturerStore = new{"url":"\/manufacturer\/list"});
var modelStore = new{"url":"\/model\/list"});
var zendDijits = [{"id":"manufacturer","params":{"label":"Manufacturer","store":"manufacturerStore","dijitParams",........];


Posted by St├ęphane Legrand (sulu45) on 2009-04-30T09:48:36.000+0000


Just to say that i have exactly the same problem. With this code :

$nom = new Zend_Dojo_Form_Element_FilteringSelect('nom'); $nom->setLabel('Nom : '); $nom->setAutoComplete(true); $nom->setStoreId('nom'); $nom->setStoreType(''); $nom->setStoreParams(array('url' => '/js/nom.js')); $nom->setAttrib(array('searchAttr' => 'nom')); $nom->setRequired(true); $form->addElement($nom);

i get the same Javascript error : is undefined

and, of course, an empty select field.

Tested with ZF 1.7.8.

Regards, Stephane.

Posted by Miguel Angel Perez (mangelp) on 2009-06-12T06:20:00.000+0000


ZF 1.8.3 is still affected by this issue despite of #5987 being closed.

Posted by Matthew Weier O'Phinney (matthew) on 2009-06-18T11:22:06.000+0000

Finally have it working correctly. prependOnLoad() does not work, as that method is used by the dojo view helper inernally just prior to rendering to create the dijits -- which means that the dijit creation happens prior to store creation. I did figure it out, however, based on a comment on ZF-5987 by Erik Wahlstrom, and now have an onLoad event that creates the store and assigns it to the dijit's store attribute. I've tested this locally and the solution is solid.

The changes have been patched to trunk and the 1.8 release branch, and will go out with 1.8.4.

Posted by Jean-Fabrice (jeanfabrice) on 2009-07-06T05:25:09.000+0000

this ZF 1.8.4 fix seems to break the following setup, known to work in ZF 1.8.3: 1/ store is statically defined in a view :

2/ filteringselect only sets up store property to targe the statically defined store : $element->setDijitParams( array( 'store' => 'myStore' ) );

With this setup and ZF 1.8.4, FilteringSelect appears empty while myStore is populated

Why am I doing things like this ? Because this is the only way I found to have a filteringselect combo working when loaded into a dojox.dialog (=dojo.dialog + executescript) with a xhrget request.


Posted by Jean-Marc Rigade (holon) on 2009-07-09T02:00:59.000+0000

I have the same problem than Jean-Fabrice. All my filtering select are empty. I have some "linked" filteringselect, when I make change on the first list, the second is affected. Now this dont work at all...

And I've a lot of filtering select in my webapp, what must I do ????

Posted by Kevin Craine (craineum) on 2009-07-14T07:58:26.000+0000

I don't know where else to put this comment, It probably is a new bug, or there might be a better work around.

In 1.8.4, doing something like this in a view:

echo $this->filteringSelect( 'select', '20', array( 'store' => 'store', 'storeType' => '', 'storeParams' => array('url' => '/my/data')) );

Fails, the 'value' is not set because the store is not loaded when it it parses the input. With a filteringSelect the input remains a textbox with the value set, but it is not a dojo object, and everything else on the page breaks. With a comboBox the value and label are set to the identifier value that I am passing instead of the label getting set properly (assuming because combo box allows things not in the store). I tried putting a 'value' option in the params array, but that doesn't seem to propagate, and even if I test this by hand it still doesn't load properly because of the way things are getting parsed.

Anyone have any idea's? Besides creating all this stuff by hand?

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.