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

Dialog must update on closing pop-up window

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

    Dialog must update on closing pop-up window

    .
    Hi,
    I have two dialogs in a parent-child setup. Both get their data from the same Students table. This is the Students table:

    student_id student_name student_height (cm)
    1 Peter Smith 182
    2 Joan Black 165
    3 Henry Higgins 177
    4 Mary Malone 159

    • The parent dialog is a read-only dialog. It contains a Repeating Section with the student_name and student_height, plus a Modify button that opens a child dialog in a pop-up window.
      Peter Smith 182 MODIFY
      Joan Black 165 MODIFY
      Henry Higgins 177 MODIFY
      Mary Malone 159 MODIFY
    • The child dialog is a simple dialog that it is updatable. It contains the student_name and the student_height corresponding to the row clicked in the first dialog, plus an Update button.
      Student name Henry Higgins
      Student height 177
      UPDATE



    What should happen:
    When the user opens the child dialog to modify a student's name or height and then clicks on the Update button:

    A) The data in the Students table is modified
    B) The pop-up child dialog closes
    C) The student's data in the parent dialog displays the modifications



    Thank you,
    Felix
    .
    Last edited by Rida Alhasan; 05-06-2013, 02:17 PM.

    #2
    Re: Dialog must update on closing pop-up window

    Here is a video to illustrate a working solution to you post. Hope this helps.

    http://screencast.com/t/zJBGTXBDT

    Comment


      #3
      Re: Dialog must update on closing pop-up window

      Have you tried emitting some js at the end of your afterDialogValidate xBasic event?

      e.javascript = "setTimeout(function() {var po = {dialog.Object}.getParentObject(); if(po) {po.populateControlsFromTable('123');} },200);"
      e.javascript = e.javascript + crlf() + "var ele = $('{dialog.ComponentName}.R1'); + crlf() + {dialog.object}.closeContainerWindow(ele);"


      Of course, you need to modify this code to include your primary key (instead of 123).
      Last edited by agillbb; 05-04-2013, 08:11 AM.

      Comment


        #4
        Re: Dialog must update on closing pop-up window

        Hi Andy,
        Thank you for the tips. I've been struggling to make it work, but no luck yet. I would be grateful if you could give me a more extended counseling.

        In the child pop-up dialog, I've added your code in Events - Server-side - afterDialogValidate. I've placed it after the code that saves the submitted data.

        ExecuteServerSideAction("Save Data::Save_Submitted_Data_to_STUDENTS")

        e.javascript = "setTimeout(function() {var po = {dialog.Object}.getParentObject(); if(po) {po.populateControlsFromTable('3');} },200);"
        e.javascript = e.javascript + crlf() + "var ele = $('{dialog.ComponentName}.R1'); + crlf() + {dialog.object}.closeContainerWindow(ele);"



        As I understand, when the user clicks the Update button, the database record shown in the child dialog is modified and then line one of your code goes into action: it retrieves record number 3 and after 200 milliseconds updates the parent dialog. Then line two of your code closes the window. But I must be missing something or not understanding it right because I cannot make it work ...



        Regards,
        Felix
        .
        Last edited by Rida Alhasan; 05-06-2013, 02:20 PM.

        Comment


          #5
          Re: Dialog must update on closing pop-up window

          Felix,

          I posted a video on here Friday. Don't know what happened to it. Here is another link.

          http://www.screencast.com/t/zJBGTXBDT

          Comment


            #6
            Re: Dialog must update on closing pop-up window

            Felix,

            Did you get this working? I have an example that I built on the Alphasport sample database. I am happy to send it to you.

            Max

            Comment


              #7
              Help: how to update parent dialog automatically when child dialog closes

              .
              Max,
              No, I have not been able to make it work. I'd be grateful to get hold of your example.



              Regards,
              Felix
              .

              Comment


                #8
                Re: Help: how to update parent dialog automatically when child dialog closes

                Here you go. I am sorry. I posted a video on this for you Friday but apparently the blog will not allow the link to post. I did not realize until earlier that it did not post.
                Attached Files

                Comment


                  #9
                  Help: how to update parent dialog automatically when child dialog closes

                  .
                  Max,
                  I've already downloaded your zip file and opened it in Alpha Five v11. I'm now going to see the innards.


                  Thank you,
                  Felix
                  .

                  Comment


                    #10
                    Re: Dialog must update on closing pop-up window

                    Felix, I have a dialog that is set up about the same way. When I click a button in the repeating section, it opens a dialog where edits can be made, and when closed the repeating section row is updated. Here is how I do it, although I am not 100% sure it is the best way.

                    To make sure it stays on the current record in the repeating section, I set a page variable called "_myRSActiveRow" as a number on the parent dialog, and put this in the Client side events:

                    if(typeof {dialog.object}._myRSActiveRow != 'undefined') {
                    {dialog.object}.setRepeatingSectionActiveRow('CONTAINER_5',{dialog.object}._myRSActiveRow);
                    {dialog.Object}.setFocus('NARCBARCD', {dialog.object}._myRSActiveRow);
                    delete {dialog.object}._myRSActiveRow
                    }


                    the button in the repeating section is setup to "Open a dialog component", and in the window javascript events: onBeforeHide I put this code:

                    var data = {dialog.object}.getValue('ID');
                    {dialog.Object}.submit();
                    {dialog.object}.populateControlsFromTable(data,false);
                    J.R.
                    Epigate Software, LLC.

                    [email protected]
                    http://www.epigate.com
                    sigpic

                    Comment


                      #11
                      Re: Dialog must update on closing pop-up window

                      .
                      J.R.,
                      Thank you for the code and indications. Would you please tell me if the following assumptions are right:

                      A) NARCBARCD is a field in the Repeating Section of your dialog
                      B) "_myRSActiveRow" is defined as numeric, and is a LOCAL variable --> dim _myRSActiveRow as N
                      C) In which Client-side event do you place the code if(typeof {dialog.object}... ?
                      D) In var data = {dialog.object}.getValue('ID'); , ID is the primary key of the table of the dialog that gets opened




                      Regards,
                      Felix
                      .

                      Comment


                        #12
                        Re: Dialog must update on closing pop-up window

                        Yes, NARCBARCD is a field which gets the focus once the update is complete.
                        Yes, _myRSActiveRow is defined as numeric and I have it set as a page variable and defined in the dialogs properties:arguments.
                        I forgot to say where that code goes. Sorry. It goes in the "afterPopulateFromTable" in the Client side events.
                        ID is my unique ID field on the dialog. It has been a long time since I did this, but you may not need that line. Try it with and without.
                        J.R.
                        Epigate Software, LLC.

                        [email protected]
                        http://www.epigate.com
                        sigpic

                        Comment


                          #13
                          Re: Dialog must update on closing pop-up window

                          .
                          Andy,
                          Max,
                          JR,
                          Thanks to your tips and indications, I finally got it working. Due to the characteristics of my dialogs, I used JR's solution. Since my parent dialog is read-only, I only needed the onBeforeHide code. JR gave this:
                          var data = {dialog.object}.getValue('ID');
                          {dialog.Object}.submit();
                          {dialog.object}.populateControlsFromTable(data,false);


                          I deleted the submit line and left it like this:
                          var data = {dialog.object}.getValue('ID');
                          {dialog.object}.populateControlsFromTable(data,false);


                          Without the submit line, it updates twice as fast. (Of course, where JR has 'ID', I placed my corresponding primary key).



                          Thank you again to all,
                          Felix
                          .

                          Comment


                            #14
                            Re: Dialog must update on closing pop-up window

                            Glad you got it working Felix. You have helped me more than once in the past, so I am glad I had a small part in repaying the favor.

                            -JR
                            J.R.
                            Epigate Software, LLC.

                            [email protected]
                            http://www.epigate.com
                            sigpic

                            Comment

                            Working...
                            X