Update a dialog window

Engaged ,
Jul 21, 2022 Jul 21, 2022

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();
TOPICS
Actions and scripting

Views

70

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , Jul 22, 2022 Jul 22, 2022

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!")
}; 

 

Likes

Translate

Translate
Adobe Community Professional ,
Jul 21, 2022 Jul 21, 2022

Copy link to clipboard

Copied

I'm not sure what you are asking. Do you want to change the values of your controls?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 22, 2022 Jul 22, 2022

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 22, 2022 Jul 22, 2022

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!")
}; 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 22, 2022 Jul 22, 2022

Copy link to clipboard

Copied

Thanks for sharing your knowledge @jazz-y 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 22, 2022 Jul 22, 2022

Copy link to clipboard

Copied

LATEST

When a window is laid out, you need to do this after adding your controls.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines