I missed out some code in my controller
Now it is working with this code
Form
$groups = new Zend_Form_Element_Multiselect('group');
$groups ->setLabel('Groups:')
->setDecorators($this->elementDecorators)
->setRegisterInArrayValidator(false)
->setAttrib('multiple','multiple')
->setMultiOptions($aGroups);
$this->addElement($groups);
Controller
$productForm = $oFrmProduct->getEditProductForm($aGroups, $groupsCnt,
$buttonMessage);
$productForm->group->setValue($sGroup);
Thanks for all
A.J. Brown-3 wrote:
>
> Have you tried:
>
> ->setDefault( $sGroup )
>
> ?
>
> On Fri, Oct 30, 2009 at 7:28 AM, ajitk15 <[email protected]> wrote:
>>
>> Hi
>>
>> this using the Zend_Form_Element_Multiselect still i the same issue
>> can any one help me out in this asap
>>
>>
>> $groups = new Zend_Form_Element_Multiselect('group');
>>
>> $groups ->setLabel('Groups:')
>>
>> ->setDecorators($this->elementDecorators)
>>
>> ->setRegisterInArrayValidator(false)
>>
>> ->setAttrib('multiple','multiple')
>> ->setValue($sGroup)
>> ->addMultiOptions($aGroups);
>>
>> $this->addElement($groups);
>>
>>
>>
>>
>>
>> Hector Virgen wrote:
>>>
>>> If you're using a regular select, the value you pass to setValue should
>>> be
>>> a
>>> single value (not an array).
>>>
>>> If you're using MultiSelect, then you need to pass in an array of
>>> values.
>>>
>>> --
>>> Hector
>>>
>>>
>>> On Tue, Oct 27, 2009 at 8:41 AM, ajitk15 <[email protected]> wrote:
>>>
>>>>
>>>> even i tried with Zend_Form_Element_Multiselect also
>>>> still the same issue.
>>>>
>>>>
>>>>
>>>> drm-4 wrote:
>>>> >
>>>> > ajitk15 wrote:
>>>> >> $groups = new Zend_Form_Element_Select('group');
>>>> >>
>>>> >> $groups ->setLabel('Groups:')
>>>> >>
>>>> ->setAttrib('multiple','multiple')
>>>> >>
>>>> >
>>>> > Hi, you should use Zend_Form_Element_Multiselect for this.
>>>> >
>>>> >
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Multiselect-selected-values-tp22125736p26079939.html
>>>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Multiselect-selected-values-tp22125736p26128468.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>
>>
>
>
>
> --
> A.J. Brown
> web | http://ajbrown.org
> phone | (937) 660-3969
>
>
--
View this message in context:
http://old.nabble.com/Multiselect-selected-values-tp22125736p26129171.html
Sent from the Zend Framework mailing list archive at Nabble.com.