YD

Hello Community,

I am trying to build a dialogue box with report. In this dialog box I would like to have a text box, in which the content can change according to another check box in the dialogue. If the check box is chosen, then the text box will show "A", and if the check box is not chosen, the text box will show "B". I have built two text boxes at the same location and I want to use setVisible() to control which text to be shown. However, if seems that if two text boxes overlap, one of the text box can not be shown correctly. (I've try to move one of the text box to a free place, then everything works well.) I am not sure if it's possible to do this with report. Can anyone help?

Thanks in advance!

by Kay Fischbach
Posted on Fri, 08/30/2019 - 17:05

I advise against this approach. Instead I would recommend one button and you simply change the text it displays.

Example:

function myDialog()
{
    this.getPages = function()
    {
        
        this.currentButtonSetting;
        
        var iDialogTemplate1 = Dialogs.createNewDialogTemplate(200, 200, "First page");
        iDialogTemplate1.PushButton(35, 5, 80, 15, "A", "BUTTON_1");
        iDialogTemplate1.CheckBox(120, 5, 100, 15, "Press", "CHECKBOX_1");
        iDialogTemplate1.Text(35, 30, 100, 16, "sampleText", "TEXT_1");
        return [iDialogTemplate1];
    }
    
    this.init = function(aPages)
    {
        currentButtonSetting = "A";
    }
    
    
    
    this.CHECKBOX_1_selChanged = function(newSelection)
    {
        if(newSelection == 0){
            this.dialog.getDialogElement("BUTTON_1").setText("A");
            currentButtonSetting = "A";
        } else {
            this.dialog.getDialogElement("BUTTON_1").setText("B");
            currentButtonSetting = "B";
        }
    }
    
    this.getResult = function()
    {
        return currentButtonSetting;
    }
    
    this.BUTTON_1_pressed = function()
    {
        if(currentButtonSetting == "A"){
            this.dialog.getDialogElement("TEXT_1").setText("Button behavior A");
        } else {
            this.dialog.getDialogElement("TEXT_1").setText("Button behavior B");
        }
    }
    
    
    
}

var result = Dialogs.showDialog(new myDialog(), Constants.DIALOG_TYPE_ACTION, "Dialog");
Dialogs.MsgBox(result);

 

I've also included an example how to make use of the different button states, because obviously you can't write two different button reaction methods anymore.

0

Featured achievement

Rookie
Say hello to the ARIS Community! Personalize your community experience by following forums or tags, liking a post or uploading a profile picture.
Recent Unlocks

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock