Profile picture for user Ariene Kroeze

Hi ,

I am struggling with the next script, with a sample of some Dialogs routines.

Function ‘canGotoNextPage ‘ doesn’t work correct anymore when method 'setActiveWizardPages' is used in the script.

In next script the same dialog is called twice: the first time without use of method setActiveWizardPages, the second time with it.

The first time function ‘.canGotoNextPage’ is correct, the second time it isn’t.

Does anyone know what I'm doing wrong?

Many thanks in advance.

Best regards,

Ariene Kroeze

This is my code:

Dialogs.MsgBox("Dialog without setActiveWizardPages, runs correct")
Dialogs.showDialog(new my_dialog(false), Constants.DIALOG_TYPE_WIZARD_NONLINEAR, "Title" )

Dialogs.MsgBox("Dialog with setActiveWizardPages, doesn't run correct")
Dialogs.showDialog(new my_dialog(true), Constants.DIALOG_TYPE_WIZARD_NONLINEAR, "Title" )

function my_dialog(bDoActiveWizardPages){
    
    this.getPages = function(){
        var Template0 = Dialogs.createNewDialogTemplate(520, 300, "Dialog 0");
        Template0.Text (10,10,400,20, "Text 0")
        
        var Template1 = Dialogs.createNewDialogTemplate(520, 300, "Dialog 1");
        Template1.Text    (10,10,400,20, "Next textbox must have value")
        Template1.TextBox (10,30,400,20, "txtBox1",0)
        
        var Template2 = Dialogs.createNewDialogTemplate(520, 300, "Dialog 2");
        Template2.Text (10,10,400,20, "Text 2")
        
        return [Template0, Template1, Template2]
    }
    this.init = function(){
        if (bDoActiveWizardPages){
            this.dialog.setActiveWizardPages([1,2]);           // <<<< this is the trouble making call
        }
    }
    this.isInValidState = function (iPageNumber){
        return true
    }
    this.canFinish = function (iPageNumber){
        return true
    }

    this.canGotoNextPage = function (iPageNumber){
        var lBool = true
        switch(iPageNumber){        
           case 1:
                var sName = this.dialog.getDialogElement("txtBox1").getText()
                if (sName==""){                    
                   lBool = false                    
                }
                break
        }
        return lBool
    }  
}
by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Mon, 02/15/2016 - 09:06

Hi Ariane,

ahm, this is interesting. If you don't use the first dialog, it works for me (7.26)...  So I have just commented out the first lines :-)

BR Robert

 

//Dialogs.MsgBox("Dialog without setActiveWizardPages, runs correct")

//Dialogs.showDialog(new my_dialog(false), Constants.DIALOG_TYPE_WIZARD_NONLINEAR, "Title" )

//Dialogs.MsgBox("Dialog with setActiveWizardPages, doesn't run correct")

Dialogs.showDialog(new my_dialog(true), Constants.DIALOG_TYPE_WIZARD_NONLINEAR, "Title" )

function my_dialog(bDoActiveWizardPages){

    

    this.getPages = function(){

        var Template0 = Dialogs.createNewDialogTemplate(520, 300, "Dialog 0");

        Template0.Text (10,10,400,20, "Text 0")

        

        var Template1 = Dialogs.createNewDialogTemplate(520, 300, "Dialog 1");

        Template1.Text    (10,10,400,20, "Next textbox must have value")

        Template1.TextBox (10,30,400,20, "txtBox1",0)

        

        var Template2 = Dialogs.createNewDialogTemplate(520, 300, "Dialog 2");

        Template2.Text (10,10,400,20, "Text 2")

        

        return [Template0, Template1, Template2]

    }

    this.init = function(){

        if (bDoActiveWizardPages){

            this.dialog.setActiveWizardPages([1,2]);           // <<<< this is the trouble making call

        }

    }

    this.isInValidState = function (iPageNumber){

        return true

    }

    this.canFinish = function (iPageNumber){

        return true

    }

    this.canGotoNextPage = function (iPageNumber){

        var lBool = true

        switch(iPageNumber){        

           case 1:

                var sName = this.dialog.getDialogElement("txtBox1").getText()

                if (sName==""){                    

                   lBool = false                    

                }

                break

        }

        return lBool

    }  

}

 

0
by Ariene Kroeze Author
Posted on Mon, 02/15/2016 - 10:31

Thank you Robert for your effort,

but I didn't test it in ARIS 7, I am using with ARIS 98.2

Here are images of the screens in the dialog:

the first one (the next button is enabled)

and the second time (with error, the next button stays disabled)

 

br, Ariene

0
by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Mon, 02/15/2016 - 16:01

Hi Ariene,

ok, the page numbers seem to change. So in your first example, you say that if iPageNumber == 1 then canGotoNextPage .

In the second one, you still say if iPageNumber == 1, but this page number would be the SECOND page...

BR Robert

 

0
by Ariene Kroeze Author
Posted on Mon, 02/15/2016 - 17:07

Hi Robert,

I'm afraid that that is not the problem (or the solution).

I have updated the call back function 'canGotoNextPage' to the code below (so now it doesn't not depend on (renumbered?) page numbers). But unfortunately still the same result.

Cheers, Ariene

this.canGotoNextPage = function (iPageNumber){
        var lBool = true
        var oPage = this.dialog.getPage(iPageNumber)
        var sPageTitle = oPage.getPageTitle()
        if (sPageTitle == "Dialog 1"){
            var oElement = oPage.getDialogElement("txtBox1")
            var sName = oElement.getText()
            if (sName==""){                    
                lBool = false                     
            }        
        }
        return lBool
    } 
0
by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Tue, 02/16/2016 - 13:23

Hi Ariane,

I have tried another few things and here are my findings (sadly only valid for 9.6 at the moment, but perhaps you can validate this for 9.8).

1) When I start it with two dialogs and your new lines, it does not work correctly

2) When I start with the code below (meaning only one call of the dialog) and I leave the text box, then enter something in the text box , it does not work

3) When I start with the code below and I directly enter something in the textbox => then it works for me in 9.6

 

//Dialogs.showDialog(new my_dialog(false), Constants.DIALOG_TYPE_WIZARD_NONLINEAR, "Title" )

Dialogs.showDialog(new my_dialog(true), Constants.DIALOG_TYPE_WIZARD_NONLINEAR, "Title" )

function my_dialog(bDoActiveWizardPages){

    

    this.getPages = function(){

        var Template0 = Dialogs.createNewDialogTemplate(520, 300, "Dialog 0");

        Template0.Text (10,10,400,20, "Text 0")

        

        var Template1 = Dialogs.createNewDialogTemplate(520, 300, "Dialog 1");

        Template1.Text    (10,10,400,20, "Next textbox must have value")

        Template1.TextBox (10,30,400,20, "txtBox1",0)

        

        var Template2 = Dialogs.createNewDialogTemplate(520, 300, "Dialog 2");

        Template2.Text (10,10,400,20, "Text 2")

        

        return [Template0, Template1, Template2]

    }

    this.init = function(){

        if (bDoActiveWizardPages){

            this.dialog.setActiveWizardPages([1,2]);           // <<<< this is the trouble making call

        }

    }

    this.isInValidState = function (iPageNumber){

        return true

    }

    this.canFinish = function (iPageNumber){

        return true

    }

    

    this.canGotoNextPage = function (iPageNumber){

          var lBool = true

          var oPage = this.dialog.getPage(iPageNumber)

          var sPageTitle = oPage.getPageTitle()

          if (sPageTitle == "Dialog 1"){

              var oElement = oPage.getDialogElement("txtBox1")

              var sName = oElement.getText()

              if (sName==""){

                  lBool = false

              }

          }

          return lBool

      }  

}

 

0
by Ariene Kroeze Author
Posted on Tue, 02/16/2016 - 13:37

Thank you Robert, for all your efforts.

I'm afraid that I have found a bug in version 98.2, I've tried the same script as yours, and no, it doesn't work.

Besides, I am focused now on function 'canGotoNextPage', but the bug caused a lot of other problems as well.

I hope that I am wrong.

Cheers, Ariene

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