views:

63

answers:

2

I have a quick question

How many dojo filteringselects can I have on a form?

I have a form with 2 filteringselects on it, both getting data from different json datastores to populate the values.

However only the first filteringselect is being populated, the other grabs no data.

I am using Zend Framework and Zend_Dojo_Form to create the form elements for this.

Many thanks.


Ok looks like my code is broken somewhere then. The element that is failing in my form is:

$location = new Zend_Dojo_Form_Element_FilteringSelect('location');
$location->setAutocomplete(true)
        ->setStoreId('countiesstore')
        ->setStoreType('dojo.data.ItemFileReadStore')
        ->setStoreParams(array('url' => $baseUrl.'/dojo/counties'))
        ->setAttrib('searchAttr', 'title')
        ->setRequired(true)
        ->removeDecorator('DtDdWrapper')
        ->removeDecorator('label')
        ->removeDecorator('HtmlTag')
        ->removeDecorator('Error');

When I go to http://localhost/dojo/counties I get the json file to read, but the element isn't populated with any data.

Any ideas?

A: 

As many as you want. There's something wrong with them if they don't work

Jani Hartikainen
A: 

check the generated id's in the browser tree, you may have an ID conflict. As well are you sure that it is not getting the data or is the data failing to bind to a store due to a data issue. If you have a _type attribute on any of the elements it will not display as the internal store will skip over them as a top level element.

kls