0

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
zadof
  • 69
  • 5

3 Answers3

1

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

gsteenss
  • 68
  • 5
0

That's a deprecated field type. You can use default dropdown and add multiselect option with setAttr method.

romaninsh
  • 10,606
  • 4
  • 50
  • 70
  • Thanks, that worked, but then when I do form->get("multiselectfield") I get only the last value, not all selected values. – zadof May 14 '12 at 02:17
0
$f = form->addField('DropDown', 'name','Caption')->setAttr('multiple')->setModel('Application');

But im still searching how to set some of records to be selected...

Peter
  • 728
  • 3
  • 16
  • 34