Here is my code that is not working.
vars = <|"x" -> <|"Q" -> "Quant", "bins" -> {10, 20, 30, 40}|>,
"y" -> <|"Q" -> "Qual", "bins" -> {"Male", "Female"}|>|>;
doVarSpecs[vars_] := DialogInput[
DynamicModule[{varlist, var, oplistquant, oplist, op, vallist, val},
g[var_] := Block[{},
oplist =
If[vars[var, "Q"] === "Quant", Keys@oplistquant,
Take[Keys@oplistquant, 2]];
op = First@oplist;
Print[op, oplist];
vallist = vars[var, "bins"]; val = First@vallist;
];
varlist = Keys@vars; var = First@varlist;
oplistquant = {"=" -> SameQ, "\[NotEqual]" -> UnsameQ,
"\[LessEqual]" -> LessEqual, "\[GreaterEqual]" -> GreaterEqual};
g[var]; Print[varlist]; Print[oplist]; Print[vallist];
Column[{
Style["Choose a Set of Variable Relations", 22, Darker@Blue],
" ",
Row[{
"Variable: ",
PopupMenu[Dynamic[var, (var = #; g[var]) &], varlist], " ",
Dynamic[PopupMenu[Dynamic[op], oplist],
TrackedSymbols :> {oplist}], " ",
Dynamic[PopupMenu[Dynamic[val], vallist],
TrackedSymbols :> {oplist}]
}],
" ",
Row[{Button["OK", DialogReturn[{var, op, val}]], CancelButton[]}]
}
]
], WindowTitle -> "Variable Specification Selector"]
For a simpler case, the question was answered previously,
In this case, when var is changed, g[var] is called and both oplist and vallist are updated, but the PopupMenu controls that use them are not updated.
The assistance of the Stack Exchange community would be greatly appreciated.