Genie Discord forum
![Author Avatar](https://cdn.discordapp.com/avatars/679661866166910986/f3ed85f7a3e27b92039307687c03613a.png?size=512)
I'm trying to build a dynamic set of radio buttons. I want to have a set of radio buttons where only one can be chosen at a time, but also be able to update that set, and track when one button is chosen.
The following fails:
module App
using GenieFramework
@genietools
@app begin
@in options = ["opt1", "opt2", "opt3"]
@in chosen = "opt1"
@onchange chosen begin
println(chosen)
end
end
function ui()
row(@recur("opt in options"), [radio(:opt, :chosen, val = :opt)])
end
@page("/", ui)
end
because radio
requires a String
, not a Symbol
, as its label.
![Author Avatar](https://cdn.discordapp.com/avatars/679661866166910986/f3ed85f7a3e27b92039307687c03613a.png?size=512)
solved just set label
to :opt
:
row(@recur("opt in options"), [radio("tmp", :chosen, val = :opt, label=:opt)])