ZF-7360: Zend_Dojo_Form_Element_FilteringSelect value is not populated after calling the populate method on the form object

Description

I hope the title says it all.

It is working well with ZF 1.8.3 but not 1.8.4 and trunk.

Comments

I am also having this issue. Examples of the Zend-generated Dojo JavaScript are below. Note all the extra dojo.addOnLoad calls in the post-1.8.4 code:

Pre-1.8.4 (this works):


And here is what it looks like in 1.8.4 and after (this doesn't work):


Can you please provide a few things? * Minimal code necessary to reproduce the issue * A detailed description of the behavior you're expecting, including the Dojo markup that should be generated to achieve the results you need * A detailed description of the actual behavior you're receiving, and why the Dojo markup generated does not work The reason for the change from 1.8.3 to 1.8.4 was due to another issue filed, in which it was reported that instantiating the data store in the same scope as the dojo.require statements was resulting in a race condition, where the store was attempting to instantiate before the actual dojo.data store class was yet loaded. Moving the store creation to an onLoad event corrected those issues.

I've tried using a datastore with a filtering select recently, and all was working as expected for me -- which is why I'd like you to answer the above questions.

Fixed in trunk and 1.9 release branch.

The fix for this has broken all of the dojo.data.ItemFileReadStore stores on my Filtering Selects. They worked fine on version 1.9.5 of the framework, but when I updated to version 1.9.6 (which this fix was included in) and all of the stores on my filtering select no longer work. Could we revert this please until we find a better solution?

I suspect this is down to the now globalised variable (meaning you're overwriting the datastore call to dojo.data.ItemFileReadStore) for the datastore rather than the re-ordering, however I'm currently in the process of finding the exact cause in the code.

Looking into this, this is purely caused on the programmatic way of doing things and it's down to the changes made for this issue in:

Dojo\View\Helper\ComboBox.php

before you were removing the store parameter passed if it was a programmatic instance, then using the dijit.byId("dropDown").attr("store", stateStore); to set the store.

This does seem to be caused by the globalised variable because it's being overwritten, the original datastore is no longer accessible via the variable for the first FilteringSelect on a page. All subsequent datastores for all subsequent FilteringSelects are overwriting the datastore before the filtering selects have ever got a chance to be initialised by Dojo, hence all filtering selects now only have the last Datastore as their data source.

I'd have to say breaking the options in a drop down is far worse than not being able to set the selected option you want when first loaded.