Highlighted

Dialog Checkbox onChange

Advocate ,
May 05, 2020

Copy link to clipboard

Copied

Hallo,

ich möchte in einem Dialog per Checkbox eine Dropdownliste auf enabled true setzen. Ich meine es schon einmal gemacht zu haben, aber irgendwie bekomme ich es nicht mehr hin.

 

 

// DIALOG
// ======
var dialog = new Window("dialog");
dialog.text = "Dialog";
dialog.preferredSize.width = 400;
dialog.orientation = "column";
dialog.alignChildren = ["left", "top"];
dialog.spacing = 10;
dialog.margins = 16;

var _checkox = dialog.add("checkbox", undefined, undefined, { name: "_checkox" });
_checkox.text = "Liste anzeigen";

_checkox.onChange = function () {
    if (_checkox.value == true) {
        _list.enabled = true;
    }
    else {
        _list.enabled = false;
    }
}

var _list_array = ["1", "2", "3", "3"];
var _list = dialog.add("dropdownlist", undefined, undefined, { name: "_list", items: _list_array });
_list.selection = 0;
_list.alignment = ["left", "top"];

dialog.show();

 

 

Könnt ihr helf

Viele Grüße
Mario
Adobe Community Professional
Correct answer by Charu Rajput | Adobe Community Professional

Hi,

Please try below, this will also set list enabled and disabled based on initial value of checkbox and also on click of checkbox.

 

 

var dialog = new Window("dialog");
dialog.text = "Dialog";
dialog.preferredSize.width = 400;
dialog.orientation = "column";
dialog.alignChildren = ["left", "top"];
dialog.spacing = 10;
dialog.margins = 16;

var _checkox = dialog.add("checkbox", undefined, undefined, { name: "_checkox" });
_checkox.text = "Liste anzeigen";

_checkox.onClick = function () {
    if (_checkox.value == true) {
        _list.enabled = true;
    }
    else {
        _list.enabled = false;
    }
}

var _list_array = ["1", "2", "3", "3"];
var _list = dialog.add("dropdownlist", undefined, undefined, { name: "_list", items: _list_array });
_list.selection = 0;
_list.alignment = ["left", "top"];
_list.enabled = _checkox.value;

dialog.show();

 

Let us know if this helps

Thanks

 

TOPICS
Performance

Views

716

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

Dialog Checkbox onChange

Advocate ,
May 05, 2020

Copy link to clipboard

Copied

Hallo,

ich möchte in einem Dialog per Checkbox eine Dropdownliste auf enabled true setzen. Ich meine es schon einmal gemacht zu haben, aber irgendwie bekomme ich es nicht mehr hin.

 

 

// DIALOG
// ======
var dialog = new Window("dialog");
dialog.text = "Dialog";
dialog.preferredSize.width = 400;
dialog.orientation = "column";
dialog.alignChildren = ["left", "top"];
dialog.spacing = 10;
dialog.margins = 16;

var _checkox = dialog.add("checkbox", undefined, undefined, { name: "_checkox" });
_checkox.text = "Liste anzeigen";

_checkox.onChange = function () {
    if (_checkox.value == true) {
        _list.enabled = true;
    }
    else {
        _list.enabled = false;
    }
}

var _list_array = ["1", "2", "3", "3"];
var _list = dialog.add("dropdownlist", undefined, undefined, { name: "_list", items: _list_array });
_list.selection = 0;
_list.alignment = ["left", "top"];

dialog.show();

 

 

Könnt ihr helf

Viele Grüße
Mario
Adobe Community Professional
Correct answer by Charu Rajput | Adobe Community Professional

Hi,

Please try below, this will also set list enabled and disabled based on initial value of checkbox and also on click of checkbox.

 

 

var dialog = new Window("dialog");
dialog.text = "Dialog";
dialog.preferredSize.width = 400;
dialog.orientation = "column";
dialog.alignChildren = ["left", "top"];
dialog.spacing = 10;
dialog.margins = 16;

var _checkox = dialog.add("checkbox", undefined, undefined, { name: "_checkox" });
_checkox.text = "Liste anzeigen";

_checkox.onClick = function () {
    if (_checkox.value == true) {
        _list.enabled = true;
    }
    else {
        _list.enabled = false;
    }
}

var _list_array = ["1", "2", "3", "3"];
var _list = dialog.add("dropdownlist", undefined, undefined, { name: "_list", items: _list_array });
_list.selection = 0;
_list.alignment = ["left", "top"];
_list.enabled = _checkox.value;

dialog.show();

 

Let us know if this helps

Thanks

 

TOPICS
Performance

Views

717

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
May 05, 2020 0
Community Beginner ,
May 05, 2020

Copy link to clipboard

Copied

_checkox.onClick = function () {
if (_checkox.value == true) {
_list.enabled = true;
}
else {
_list.enabled = false;
}
}

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
Reply
Loading...
May 05, 2020 0
Adobe Community Professional ,
May 05, 2020

Copy link to clipboard

Copied

Hi,

Please try below, this will also set list enabled and disabled based on initial value of checkbox and also on click of checkbox.

 

 

var dialog = new Window("dialog");
dialog.text = "Dialog";
dialog.preferredSize.width = 400;
dialog.orientation = "column";
dialog.alignChildren = ["left", "top"];
dialog.spacing = 10;
dialog.margins = 16;

var _checkox = dialog.add("checkbox", undefined, undefined, { name: "_checkox" });
_checkox.text = "Liste anzeigen";

_checkox.onClick = function () {
    if (_checkox.value == true) {
        _list.enabled = true;
    }
    else {
        _list.enabled = false;
    }
}

var _list_array = ["1", "2", "3", "3"];
var _list = dialog.add("dropdownlist", undefined, undefined, { name: "_list", items: _list_array });
_list.selection = 0;
_list.alignment = ["left", "top"];
_list.enabled = _checkox.value;

dialog.show();

 

Let us know if this helps

Thanks

 

Best regards

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
Reply
Loading...
May 05, 2020 2
Advocate ,
May 05, 2020

Copy link to clipboard

Copied

Thanks!!!!!!

Viele Grüße
Mario

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
Reply
Loading...
May 05, 2020 0
Adobe Community Professional ,
May 05, 2020

Copy link to clipboard

Copied

Most welcome.

 

Best regards

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
Reply
Loading...
May 05, 2020 0