No announcement yet.

Auto close a dialog bx after selection

  • Filter
  • Time
  • Show
Clear All
new posts

  • Auto close a dialog bx after selection

    Hello everybody,

    I am a complete newbie and need help.
    I created a page from which sales department can load different documents like brochures, drawings presentations, etc. in multiple languages.
    Once you click on a document a dialog box opens with the different buttons for the language. Clicking on a button will open the document in the desired language.
    What I want to do is that this dialog box automatically closes after the language selection has been made.
    Right now I added a "close" button to close the dialog box which I find cumbersome.

    I did not find any settings or properties on the box or buttons nor do I have a clue what code to use to close the dialog box automatically after a selection has been made.
    Can somebody help??

  • #2
    Hello Ernesto,

    What type of dialog box?
    Can you post the apz?


    • #3

      a simple example



      • #4
        I do not even know what you mean with apz?

        I created the dialog out of the menu. See below.

        Click image for larger version

Name:	Dialog.jpg
Views:	168
Size:	103.4 KB
ID:	305372


        • #5

          take a look at herrin's attachment


          • #6
            Thanks, looks good,
            Need to see how to integrate it into my tool


            • #7
              Unfortunately it was not a total success.
              Could incorporate your code and the required documents are opened, but the dialog did not close and the following Error mesaage appeared.

              Click image for larger version

Name:	2020-08-17 09_02_43-Start.jpg
Views:	112
Size:	11.7 KB
ID:	305388


              • #8
                Hi Ernesto,
                It would be much better if you posted your code for Button 2 & 7 and Globals instead of just a pic of error message?
                Much Better post sample of your apz ( page plus dialog) as it is hard for programmers to visulize what you are actually doing wrong, the code herrin posted works perfectly
                Just a side note - Did you code buttons etc with script editor or use drag and drop method or quick action?
                It just seems like you have a lot of pages and dialogs, [ I once helped a chap that had 63 pages in his project - from him using quick actions and I reduced it to 10 pages with code]


                • #9
                  Hi Colc,

                  it took me a while to find out how to create a *.apz file.

                  And YES; I used quick actions to code buttons. I did not know how to define globals etc., this is why globals or not in.
                  And YES, I do have quite a number of pages. To give you an idea I put together a sample file to show how my tool was built.



                  • #10
                    Hi Colc,

                    I am not sure if the *.apz file was attached
                    Attached Files


                    • #11
                      dialog reworked



                      • #12
                        Hi Ernesto ,
                        Yes your export was screwed up but I exported the pages & dialog and rebuild it.
                        You can't have quick actions and code together.
                        I have modified your Sample and have used 2 pages with only 1 dialog with brochures in diff lang , when the dialog opens it sets the header label to the product
                        then when you click a lang it opens selected product in that language by using if and elseif script.

                        It may seem daunting but for a large project like your's I think you will have to read the manual and learn how to code
                        So check out redone sample


                        • #13
                          Hi Colc,

                          Thanks a lot for your patience and help. The code works fine. I knew I should read the manual but I needed something quickly. This is why I started the way I did.

                          But again your quick and detailed help and guidance are highly appreciated and very welcome. THANK YOU