Consider the following example:
Manipulate[{1}[[i]], {i, {1 -> "a"}}]
Execute it and you'll get:
The correct result will be displayed if you select a
from the popup menu, but the red box won't go away:
The issue doesn't raise if I build something similar in a lower level way:
DynamicModule[{x}, {PopupMenu[Dynamic@x, {1 -> "a"}], Dynamic@{1}[[x]]}]
What am I doing wrong here? Or it's a bug?
OK, it's not a bug. Here's the response from WRI:
Yes, the first implementation (this refers to my first code sample) is an inappropriate way of specifying a control in Manipulate.
Proper ways are shown in Kuba's comment and Chris Degnen's answer below.
Initialization
, I wouldn't say controllers are responsible for initial values and logical content of body of Manipulate. It's user task to make it reasonable. $\endgroup$ – Kuba♦ Oct 11 '15 at 21:53