AxSelector type

Selector is a UI element for selecting Adaptix data.

SelectorFile

The selector_file element contains a file path input field and a button to invoke a file selection dialog. If the selector_file is placed in a container, the file contents will be base64 encoded when generating the JSON.

element create_selector_file() - Constructs a selector_file element contains a file path input field and a button to invoke a file selection dialog.

Methods:

1

setPlaceholder

void selector_file::setPlaceholder(string text);

This method sets the textline placeholder text, text.

Example
let selector = form.create_selector_file();
let btn      = form.create_button("Dump");
let tl1      = form.create_textmulti();

let container = form.create_container();
container.put("content", selector);

form.connect(btn, "clicked", function(){
    tl1.setText(container.toJson());
});

let layout = form.create_vlayout();
layout.addWidget(selector);
layout.addWidget(tl1);
layout.addWidget(btn);

let dialog = form.create_dialog("");
dialog.setSize(400, 200);
dialog.setLayout(layout);
dialog.exec();

SelectorCredentials

The selector_credentials is a dialog window with the Credentials Manager table and a search field. The columns that the table should have can be specified when creating selector_credentials.

dialog create_selector_credentials(string headers) - Creates a selector_credentials dialog with the specified headers. Possible columns are: username, password, realm, type, tag, date, storage, agent_id, host.

Methods:

1

setSize

void create_selector_credentials::setSize(int w, int h)

This method sets the size for the window.

2

close

void create_selector_credentials::close();

Close window.

3

exec

map(string,any)[] create_selector_credentials::exec();

Shows the dialog as a modal dialog, blocking until the user closes it. If the window is closed by pressing the Choose button, the method will return an array of CRED structures. If the window is closed otherwise, an empty array will be returned.

// CRED STRUCTURE:
string cred["username"]
string cred["password"]
string cred["realm"]
string cred["type"]
string cred["tag"]
string cred["date"]
string cred["storage"]
string cred["agent_id"]
string cred["host"]
string cred["id"]
Example
let creds_selector = form.create_selector_credentials(["username", "password", "realm", "tag"]);
creds_selector.setSize(800, 400);

let username_label = form.create_label("Username:");
let username_text  = form.create_textline();
let select_button  = form.create_button("...");
let password_label = form.create_label("Password:");
let password_text  = form.create_textline();
let realm_label    = form.create_label("Realm:");
let realm_text     = form.create_textline();

form.connect(select_button, "clicked", function(){
    let cred_list = creds_selector.exec();
    if (cred_list.length > 0) {
        let cred = cred_list[0];
        username_text.setText(cred["username"]);
        password_text.setText(cred["password"]);
        realm_text.setText(cred["realm"]);
    }
});

let layout = form.create_gridlayout();
layout.addWidget(username_label, 0, 0, 1, 1);
layout.addWidget(username_text,  0, 1, 1, 1);
layout.addWidget(select_button,  0, 2, 1, 1);
layout.addWidget(password_label, 1, 0, 1, 1);
layout.addWidget(password_text,  1, 1, 1, 1);
layout.addWidget(realm_label,    2, 0, 1, 1);
layout.addWidget(realm_text,     2, 1, 1, 1);

let dialog = form.create_dialog("");
dialog.setSize(400, 300);
dialog.setLayout(layout);
dialog.exec();

Last updated