Reputation: 69
Does anybody have a good example on how to use multiSelect field on a form? There is nothing in the documentation about it.
If I add it like any other field I get an error. I am using atk 4.2.
This code:
$f = $form->addField('multiSelect', 'name', 'Caption');
will raise this error
Exception_Logic
Method is not defined for this object
Additional information:
class: jUI
method: addPlugin
arguments: Array ( [0] => multiSelect )
.../atk4/lib/BaseException.php:38
Upvotes: 0
Views: 193
Reputation: 728
$f = form->addField('DropDown', 'name','Caption')->setAttr('multiple')->setModel('Application');
But im still searching how to set some of records to be selected...
Upvotes: 0
Reputation: 68
There was a bug in the 'dropdown' Form Field when using setAttr('multiple') which resulted in only returning the last selected value, this has now been resolved by ATK4 developers in github, see: https://github.com/atk4/atk4/pull/233
Upvotes: 1
Reputation: 10664
That's a deprecated field type. You can use default dropdown and add multiselect option with setAttr
method.
Upvotes: 0