-- Themselves <[EMAIL PROTECTED]> wrote
(on Sunday, 21 September 2008, 10:17 PM -0700):
> Hi guys, I'm just playing with the new Dojo forms in 1.6, and so far they're
> great, I'm just trying to wrap my head around some of the combobox
> functionality...
>
> One of the features of comboboxes is that you can provide a drop down list
> of options in addition to permitting the user to enter text directly in to
> the input. This is working fine for me, except for when I try to populate
> the form for editing a record.
>
> Unless the value of the field is one of the options in the list, it seems
> you can't set populate a combobox. I've even tried
> $form->getElement('field')->setValue($array['key']); in the controller after
> calling the populate method, and still nothing.
>
> Is this expected behaviour? I was under the impression that a combobox
> should cleanly handle values that aren't in the options list, which is kind
> of the point of them I thought. Or am I missing something here?
A few things to understand about ComboBox:
* The label displayed is also the value submitted. Don't quite
understand why this is the case, but it is.
* You can type in a value NOT in the list of values in the ComboBox,
and it will submit that value
* On the server side, when creating the ComboBox, setting the value to
a value not in the list simply will not work; it operates as if it
were a multi-select list. This is partly due to limitations of the
Zend_Form implementation, and partly due to limitations of how to
present that information via markup to Dojo.
--
Matthew Weier O'Phinney
Software Architect | [EMAIL PROTECTED]
Zend Framework | http://framework.zend.com/