Copy link to clipboard
Copied
Hello guys! Is there any way to update all elements in a dialog without restarting it.
w = new Window("dialog"); w.text = "FinalisarPedido";
w.orientation = "column";
p1 = w.add("panel", undefined, undefined, {name: "p1"});
p1.text = "Panel";
p1.orientation = "column";
p1.alignChildren = ["left","top"];
p1.spacing = 10;
p1.margins = 10;
st1 = p1.add("statictext", undefined, undefined, {name: "st1"});
st1.text = "StaticText";
et1 = p1.add('edittext {properties: {name: "et1"}}');
et1.text = "EditText";
b1 = p1.add("button", undefined, undefined, {name: "b1"});
b1.text = "Button";
ck = p1.add("checkbox", undefined, undefined, {name: "ck"});
ck.text = "Checkbox";
rb = p1.add("radiobutton", undefined, undefined, {name: "rb"});
rb.text = "radio button";
dl_array = ["Item 1","-","Item 2"];
dl = p1.add("dropdownlist", undefined, undefined, {name: "dl", items: dl_array});
dl.selection = 0;
b2 = w.add("button", undefined, undefined, {name: "b2"});
b2.text = "Updade W";
b2.onClick = function(){
alert("Redraw or reset this window without closing it!")
};
w.show();
Redraws the dialog, updating the position of all elements. But I'm not sure if this is exactly what you need.
b2.onClick = function(){
w.layout.layout(true)
alert("Redraw or reset this window without closing it!")
};
Copy link to clipboard
Copied
I'm not sure what you are asking. Do you want to change the values of your controls?
Copy link to clipboard
Copied
Hi @Lumigraphics , the solution I need is exactly the grandiose @jazz-y 's answer which I'm very grateful. Thanks for sharing knowledge.
Copy link to clipboard
Copied
Redraws the dialog, updating the position of all elements. But I'm not sure if this is exactly what you need.
b2.onClick = function(){
w.layout.layout(true)
alert("Redraw or reset this window without closing it!")
};
Copy link to clipboard
Copied
Thanks for sharing your knowledge @jazz-y
Copy link to clipboard
Copied
When a window is laid out, you need to do this after adding your controls.