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

How to Close Modal UX Unbound Popup Window?

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

    How to Close Modal UX Unbound Popup Window?

    HELP,


    Does any know how to "Close a Modal UX Unbound Popup Window" and where to put the code in the UX component ( ie. clientside - afterResetForm )?


    Mark


    #2
    Re: How to Close Modal UX Unbound Popup Window?

    Depending on how you are calling it. There is a flag that you can set. "Window title has close button".

    Comment


      #3
      Re: How to Close Modal UX Unbound Popup Window?

      Ivasic,


      Thank you so much for your reply, and yes that button option is checked and yes there is an 'X' in the upper right of the Title.

      But what I want to do is close the Popup Window after the person presses the submit button that I have on the Popup.

      This is a UX Unbound Popup Window invoked from a Javascript Action using the Open a UX Component where the Window-Type is set to Modal-Popup.

      I pass data from the invoking UX by way of Arguments, which are used to set the value of the Textboxes, and when the user is finished changing those fields they are used to update the two or three MSSQL Database Tables when they press the Submit ( Xbasic code is used to do the updates ). After the updates are complete an Email is sent out with a notification message.

      After this is all done, I want to close the Popup Window, but all of the code that is out there does not work, or I have not been able to make it work.


      Mark

      Comment


        #4
        Re: How to Close Modal UX Unbound Popup Window?

        Try this after your data saving code...

        Code:
        {dialog.object}.closeContainerWindow(this);
        Mike Brown - Contact Me
        Programmatic Technologies, LLC
        Programmatic-Technologies.com
        Independent Developer & Consultant​​

        Comment


          #5
          Re: How to Close Modal UX Unbound Popup Window?

          mikeallenbrown,



          Thank you so much for responding, but alas it did no work.

          I have attached a small example of two UX'es - OpenPopupWindow and ClosePopupWindow, please try them out and maybe you can figure out a solution.


          Mark
          Attached Files

          Comment


            #6
            Re: How to Close Modal UX Unbound Popup Window?

            In your closePopupWindow component button number 2 (with my code suggestion) works.
            Mike Brown - Contact Me
            Programmatic Technologies, LLC
            Programmatic-Technologies.com
            Independent Developer & Consultant​​

            Comment


              #7
              Re: How to Close Modal UX Unbound Popup Window?

              mikeallenbrown,


              Not on my machine, what browser are you using?



              Mark

              Comment


                #8
                Re: How to Close Modal UX Unbound Popup Window?

                Wait,


                The Demo does work with your code, however it does not work with mine.

                Here is the way the Submit button is set up on my UX Component

                JavaScript
                Click
                Action Javascript

                1. Ajax Callback - calls Xbasic routine to update MS SQL Database Table A
                2. Ajax Callback - calls Xbasic routine to update MS SQL Database Table B
                3. Send email
                4. Inline-JavaScript - {dialog.object}.resetForm(false);
                5. Inline-JavaScript - {dialog.object}.closeContainerWindow(this);


                Is there a way to place a wait action to delay the processing of the closeContainerWindow(this), from happening to quickly?


                Mark

                Comment


                  #9
                  Re: How to Close Modal UX Unbound Popup Window?

                  Shouldn't matter what browser is being used.

                  There is a lot going on with your code there. First, why do you need to reset the form before closing the window? That isn't necessary, is it? It's going to be closed. Second I'd execute #1 callback first. When it's complete execute #2. When that's complete execute your send email routine (in my code example below I presume you're using a javascript action for this). When that's complete then close the window (you can use the JS actionscript 'After message sent' event that the Send email message offers).

                  Code:
                  function updateOne as c (e as p)
                  
                  	'execute your code here
                  	
                  	updateOne = "{dialog.object}.ajaxCallback('','','updateTwo','','',{chunkedResponses: {allow: false},deviceOfflineFunction: function() {   }});"	
                  
                  end function
                  
                  
                  function updateTwo as c (e as p)
                  
                  	'execute your code here
                  	
                  	updateTwo = "{dialog.object}.runAction('SEND_EMAIL');"
                  	
                  end function
                  Mike Brown - Contact Me
                  Programmatic Technologies, LLC
                  Programmatic-Technologies.com
                  Independent Developer & Consultant​​

                  Comment


                    #10
                    Re: How to Close Modal UX Unbound Popup Window?

                    mikeallenbrown,


                    So let me get this straight,

                    1. In the Action Javascript have One "Ajax Callback" which calls Xbasic routine to update MS SQL Database Table A
                    2. Modify the Xbasic Code in #1 and add the "" updateOne = "{dialog.object}.ajaxCallback('','','updateTwo','','',{chunkedResponses: {allow: false},deviceOfflineFunction: function() { }});" "" which will run the Second Xbasic routine.
                    3. Modifiy the Second Xbasic routine to add the running of the Send Email routine and finally add the " {dialog.object}.closeContainerWindow(this); " to the After Message Event of the Send Email routine.


                    Then copying the Javascript Action "SendEmail", "View JavaScript", "Xbasic Callback Function" as below and this is what would be called by the After Message Event?


                    If this is what you meant, I think I understand on how it flows, could you tell me why this will work, or better yet why the other way failed?


                    Mark


                    function SEND_EMAIL as p ()
                    dim v as p
                    with v
                    DIM part as C = "Dialog2"
                    DIM sendMethod as C = "Internal"
                    DIM mandrillKey as C
                    DIM sparkPostKey as C
                    DIM useDefaultSettings as L = .T.
                    DIM smtp_server as C
                    DIM smtp_username as C
                    DIM smtp_password as C
                    DIM smtp_port as C
                    DIM smtp_SSLOption as C
                    DIM from as C = "[email protected]"
                    DIM from_alias as C = "support"
                    DIM messageSubject as C = "{Store_Name}Service Request"
                    DIM sendTo as C = "{EMail};{Technician_Email};"
                    DIM cc as C
                    DIM bcc as C = "XXXXXXXXXXXXXXXXXXXX"
                    DIM loadMessageFromRepository as L
                    DIM howToSpecifyRespositoryName as C = "SpecifyNow"
                    DIM messageNameInRepository as C
                    DIM howToSpecifyMessage as C = "SpecifyNow"
                    DIM messageBodyHTML as C = <<%str%
                    <img src="https://XXXXXXXXXXXXXXX.png" style="width:px;height:px"><br><br>
                    {Store_Name} - <b>{Store_ID}</b><br>
                    {Store_Address1}<br>
                    {Store_City}, {Store_State} {Store_ZIP}<br>
                    <br>
                    {Store_Contact_Name}<br>
                    {Store_Contact_Title}<br>
                    <br>
                    {Phone}<br>
                    <br>
                    This Email is to inform you that your Service Technician: {Technician_Name}<br>
                    will be at your Store to work on your Ice Machine on: {Technician_ScheduledOnsite}.<br>
                    <br>
                    Servive Request Case Number: {Case_Number}<br>
                    <br>
                    Issue: {Case_Issue_Type}<br>
                    <br>
                    <br>
                    Details: {Description}<br>%str%
                    DIM messageBodyText as C
                    DIM attachments as C
                    DIM storeMessageInOutbox as L
                    DIM clientSideEvent as P
                    DIM clientSideEvent.afterMessageSent as C = "SendEmail_Alert"
                    DIM showConfirmationMessage as L = .T.
                    DIM confirmationMessageSuccess as C = "Message was sent."
                    DIM confirmationMessageFailure as C = "Message was not sent because of an error."
                    DIM useDotNetLibrary as L
                    DIM sendWhen as C = "Immediate"
                    DIM WorkQueueFormat as C = "XbasicScript"

                    end with
                    SEND_EMAIL=v
                    end function

                    Comment


                      #11
                      Re: How to Close Modal UX Unbound Popup Window?

                      Originally posted by markemoss View Post

                      why the other way failed?

                      SEND_EMAIL=v
                      Maybe this is the culprit. You're emitting 'v' back to the browser in your send email function. That seems like a typo to me. If you comment out the SEND_EMAIL=v part in your original code does the original code then work? I'm guessing the SEND_EMAIL=v caused a javascript error preventing the rest of the code from running.
                      Mike Brown - Contact Me
                      Programmatic Technologies, LLC
                      Programmatic-Technologies.com
                      Independent Developer & Consultant​​

                      Comment


                        #12
                        Re: How to Close Modal UX Unbound Popup Window?

                        mikeallenbrown,


                        I did not create the function Send_Email, I went into the button Javascript click event selected Action Javascript and then select the Action of 'Send email' and filled in the required fields.

                        If you select the SendEmail action and then click on the View Javascript and then select the Xbasic CallBack Function Tab, you will see the code that it generate's.

                        Please take a look at the two screen shots.


                        Mark
                        Attached Files

                        Comment


                          #13
                          Re: How to Close Modal UX Unbound Popup Window?

                          the code in your test case is wrong.


                          the first button is not going to work because you have a button in the child component, but the window is part of the parent component.
                          in other words, the window you are trying to close is part of the parent component, but the button you are trying to define is part of the child component.
                          so your code to get the pointer to the window fails.

                          furthermore - while you did give the window an explicit name in the action that opens the child window You did NOT use this name in your code which tried to close the window.



                          you would need to convert your action javascript to text mode so that you can edit it and then change it to this:







                          Code:
                          var name = 'MYWINDOW'
                          var po = {dialog.object}.getParentObject() //get a pointer to the parent component
                          if(po) {
                               var win = po.getWindow(name); //get a pointer to the window -- the window is a member of the parent component
                               if(win) win.hide();
                          }




                          Your second button is also wrong:


                          You have

                          Code:
                          {dialog.object}.closeContainerWindow(this);

                          Not sure what you meant by the 'this' in the command, but 'this' would be a reference to the button that you have the code on. So that can't work.
                          Furthermore, you are calling a method to close a container window.

                          The window you are trying to close is not a container window. Container windows are windows that are created by using the 'Window' container control.

                          Comment


                            #14
                            Just wanted to say thanks! Spent all morning trying to figure this out using the documentation but alas nothing worked until I dug down this far.

                            Comment

                            Working...
                            X