Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Closing popups

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Closing popups

    Is anyone else spending inordinate amounts of time trying to get popups to close? I know about a half dozen ways to do it, yet often (including the last two days) just cannot get 'em to close.

    Some methods I know about/have tried include:

    - Setting the calling method to close the window after submit
    - Declaring the window[] name in the UX OnInitializeComplete and close that
    - Inserting a <div> to the UX window title and hiding that
    - using {dialog.Object}.closeContainerWindow(this);
    and a few other less-common methods

    One current example is a popup UX where I try {dialog.Object}.closeContainerWindow(this). I've tried it in several locations/methods/implementations by the way. The Chrome console tells me:

    Uncaught TypeError: Object function (obj){if(obj.responseText)eval(obj.responseText);} has no method 'getAttribute' a5-19704257.js:547
    A5.windows.getFromElement a5-19704257.js:547
    A5.DialogComponentHelper.closeContainerWindow a5-19704257.js:11429
    (anonymous function) VM2927:6
    $a._rh._eval a5-19704257.js:242
    (anonymous function)
    I'm spending enough time on this to cast a net to see what I can learn -- I have to be missing something because the problem just so pervasive in my current project.
    -Steve
    sigpic

    #2
    Re: Closing popups

    Hey Steve,

    There are about a billion (yes... a billion) ways to work with 'popups'. Right now I can only think of 4, but it feels like a billion. Could you put together a really simple example of a popup not closing? Then focus can go to exactly the problem instead of going off on some tangent that proposes a solution which doesn't apply.

    Comment


      #3
      Re: Closing popups

      I am having the same issue as Steve can anyone shed a light on this problem?
      Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

      Comment


        #4
        Re: Closing popups

        I've worked through many of them - often with Andy Meer's help but they can be downright stubborn. A couple of them I've just told my customer they're going to have to click the Close button when done.
        -Steve
        sigpic

        Comment


          #5
          Re: Closing popups

          I have burned up about 2 hours trying the examples to get a popup window ux to close. Not too much trouble if the popup is a grid. I can get the ID of the <div> object like this and hide it but then I cannot reopen.
          Code:
          //var wObj = $("A5dlg3");
          //wObj.hidden = 'true';
          I tried these everywhere and no success.
          Code:
          {dialog.Object}.closeWindow('WNDGETSIGNATURE');
          dialog.Object}.closeContainerWindow(this); (this throws an error in firefox)
          var ele = $('WNDGETSIGNATURE'); 
          dialog.Object}.closeContainerWindow(ele);
          I have decided to try opening my ux in a dynamic panel. Any ideas on how to programmatically close a dynamic panel?
          Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

          Comment


            #6
            Re: Closing popups

            I took to a similar solution in recent days. My current development app doesn't use panels, but I built a UX with conditional containers and find I can manage that pretty well. With a bit of design consideration to "fit" into the project, I'm probably going to do more of this rather than deal with uncloseable popups.
            -Steve
            sigpic

            Comment


              #7
              Re: Closing popups

              Video D 50 shows another method to open pop ups that can be easily closed. I will have to rethink things a bit.
              Actually video UX 54 clears it all up. The examples and help dialogs are missing some key commands.
              Last edited by frankbicknell; 03-17-2014, 07:26 PM.
              Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

              Comment


                #8
                Re: Closing popups

                I've seen Selwyn's videos using that method before, but never used it even though I thought it quite clever. I'll take to using/trying that in the future as well, see if it helps save some time. Thanks for finding and pointing that out.
                -Steve
                sigpic

                Comment


                  #9
                  Re: Closing popups

                  I don't know how getting the id of a button then using that id in the closeContainerWindow method works.... but it does.

                  OK I see why this works now because
                  this works in a button.
                  Code:
                  {dialog.Object}.closeContainerWindow(this);
                  I guess you could get a pointer to any component in the window. Maybe only buttons.
                  Last edited by frankbicknell; 03-18-2014, 07:40 AM.
                  Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

                  Comment


                    #10
                    Re: Closing popups

                    From other threads on this topic:

                    To close a popup grid component there is:
                    {grid.object}.closeParentContainer();

                    The trick is calling it at the right time and place. Wrap it in a function declared in the component's global js functions like this to ensure "{grid.object}" placeholder is properly replaced:
                    function ClosePopupXXX() { {grid.object}.closeParentContainer(); }


                    Call the function after a successful record insert/update/delete ajax call, by adding it to the javascript response code for server-side events "AfterUpdateRecord", "AfterInsertRecord", "AfterDeleteRecord":
                    aa = e.rtc.A_AjaxResponses
                    aa[].text = RefreshParentXXX(e) // add your own js function to update controls in parent record with changed data
                    aa[..].id = 100

                    aa[].text = "setTimeout('ClosePopupXXX ();', 20);" // slight delay of '10' or '20' ms to give above code time to execute before actually closing window.
                    aa[..].id = 101

                    NOTES:
                    - I define a "RefreshParentXXX" JS function to update controls in the parent window with changed data from the popup, omit if not needed.
                    - I've only tested / used this in the "AfterUpdateRecord" event.
                    - I had to add this because my popup grid component has a hidden grid and only uses an "OnPage" detail view. The "Close detail view after submit" property isn't any use in this situation because it doesn't know it should also close the hidden grid (entire popup) after a submit.

                    Comment


                      #11
                      Re: Closing popups

                      I have the same issue. in UX, i have a button, once i click it, it will run ajax callback, at the end of xbasic function, i put functionname="{dialog.Object}.closeContainerWindow(this);"
                      it is not wokring, and get error message....Anyone can help me?

                      Comment


                        #12
                        Re: Closing popups

                        Originally posted by jennygong View Post
                        I have the same issue. in UX, i have a button, once i click it, it will run ajax callback, at the end of xbasic function, i put functionname="{dialog.Object}.closeContainerWindow(this);"
                        it is not wokring, and get error message....Anyone can help me?
                        If I read your problem correctly you placed a javascript function in your xbasic code ... I don't believe you can do this. Try making another javascript action for your button (inline javascript). Makes sure you run the actions synchronously.
                        Mike Brown - Contact Me
                        Programmatic Technologies, LLC
                        Programmatic-Technologies.com
                        Independent Developer & Consultant​​

                        Comment


                          #13
                          Re: Closing popups

                          Originally posted by mikeallenbrown View Post
                          If I read your problem correctly you placed a javascript function in your xbasic code ... I don't believe you can do this. Try making another javascript action for your button (inline javascript). Makes sure you run the actions synchronously.

                          This method usually works in grid component. If using your way, i could not find javascipt action insert button in UX component.

                          Comment


                            #14
                            Re: Closing popups

                            relying on 'this' to get a pointer to the dialog to close the window seems to be unreliable, particularly after a callback.

                            try picking the ID of a component on the dialog (any button, it doesn't matter which one) and use that to get a pointer to the dialog window:

                            // close window
                            var ele = {dialog.Object}.getPointer('BUTTON_SUBMIT');
                            {dialog.Object}.closeContainerWindow(ele);

                            Comment


                              #15
                              Re: Closing popups

                              Both Mike Brown and Robert V have pointed the answer, thanks for that, sure helped me out!

                              In my case, I have a UX popup window that I want to close as the Submit button is clicked (i.e. close the window after the record is saved)

                              For the sake of clarity I've attached a screen shot for Jenny and others.

                              ClosePopupUX_OnSubmit.png

                              which shows, on the Submit button Click event

                              create two inline Javascript

                              and make sure "Run actions synchronously" is checked true

                              + Add New Action
                              -- Ajax Callbacks and Javascript
                              ---- Inline-Javascript

                              the code inside the first Inline-Javascript is

                              {dialog.object}.submit();


                              the code inside the second Inline-Javascript is

                              var ele = {dialog.Object}.getPointer('BUTTON_SUBMIT');
                              {dialog.Object}.closeContainerWindow(ele);



                              This also requires that in your Server Side Events
                              in "afterDialogValidate"
                              you have the usual server side action script which saves the record

                              i.e.

                              ExecuteServerSideAction("Save Data::Save_Submitted_Data_to_Table_s_")

                              Comment

                              Working...
                              X