Hey all I’ve been trying to use Julias on board UI for a few things. I’m having a hard time getting things the way I want them. Totally fine with making buttons, and having them do tasks on observables, everythings good there! Can’t seem to find a simple way, or if it’s even possible, to say press a button and update the text in a textbox.
Something like this,
using Interact, WebIO, Blink
#Blink.AtomShell.install()
btn = button("Btn Text");
rltxt = Observable{Any}("Default Text");
txt = textbox(rltxt[]);
map!(btn.scope.dom.children.tail[1], rltxt, btn);
#btn.scope.dom.children.tail[1]
w = Window()
body!(w, hbox(btn, txt))
edit I solved that with the following:
using Interact, WebIO, Blink
#Blink.AtomShell.install()
btn = button("Btn Text");
rltxt = Observable{Any}("Default Text");
txt = textbox(rltxt[]);
map!(t -> btn.scope.dom.children.tail[1], txt, btn);
w = Window()
body!(w, hbox(btn, txt))
But how about an autocomplete box?
btn = button("Btn Text");
rltxt = Observable{Any}(["Default Text1","Default Text2"]);
txt = autocomplete( rltxt[] );
map!(t -> [btn.scope.dom.children.tail[1],"cookies"], txt, btn);
w = Window()
body!(w, hbox(btn, txt))
woop solved that one too,
btn = button("Btn Text");
rltxt = Observable{Any}(["Default Text1","Default Text2"]);
txt = autocomplete( rltxt );
map!(t -> [btn.scope.dom.children.tail[1],"cookies"], rltxt, btn);
w = Window();
body!(w, hbox(btn, txt))
Might be good to add this sort of thing to the docs.