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

Open 2nd modal Grid after new record

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

    Open 2nd modal Grid after new record

    Ideally*, I would like to do the following:

    Open a modal grid for new record only (no problem).
    On the submit, I want to:
    1. Get the auto-increment id value (which is shown as <auto>)
    2. Close the modal entry form
    3. Open a different modal grid synced to display new record I just created.
    There seem to be different ways to do this, but I can't them to work. One significant stumbling block is that I think the grid closes on submit and never holds the newly created autoinc ID. Thus I get an error message saying "ID not found".
    ---
    * I'm willing to compromise on the modal aspect, and if need be, I'll substitue an a5w page for the grid, although I would prefer the grid.

    Gotta be a way to get this to work!
    Peter
    AlphaBase Solutions, LLC

    [email protected]
    https://www.alphabasesolutions.com



    #2
    Re: Open 2nd modal Grid after new record

    Using the grid's onPageRedirect event works and opens the a5w page:

    e.url = "Pay_Allocate.a5w"
    Of course, this displays the 1st record in the table, not the one I just created.

    But this doesn't work:

    e.url = "Pay_Allocate.a5w?Payment_Id=" + e.rv.v.r1.Payment_Id

    The error message says it can't find the e.rv.v.r1 subelement.
    Peter
    AlphaBase Solutions, LLC

    [email protected]
    https://www.alphabasesolutions.com


    Comment


      #3
      Re: Open 2nd modal Grid after new record

      Hi Peter,

      If I am understanding this correctly this is how I do it.

      Grid with the Detail view set to enter new record. On the grids properties tab, in JavaScript - system events, in the AfterDetailViewSubmit event I put the following JavaScipt
      Code:
      {grid.Object}.closeDetailView();
      {grid.Object}.pageNavigate('last')

      Comment


        #4
        Re: Open 2nd modal Grid after new record

        After insert record returns the key from the database put that in a session var and open the other grid. By using LAST it is not 100% that it is your key unless your app is single user.

        Eric

        Comment


          #5
          Re: Open 2nd modal Grid after new record

          I've covered this before ... In V10 you need to reference the rows of an uncommitted new record as r_1 instead of r1.

          Now, since you are creating a new record and the key field is set to auto-increment by the database, it never gets set until you actually commit the record to the table.

          So what I do is setup a uuid field that I can populate with the api_uuidcreate() function for it's initial value and then reference that field as the linking field on submit. This is very reliable and works great.

          I like to use session variables here to keep the URL untouched but you can use either technique.
          Bob Moore


          Comment


            #6
            Re: Open 2nd modal Grid after new record

            To document the workflow I just described ..

            In the grid update settings, set the redirect page to <Event>.
            In the grid Events, on PageRedirect ...

            e.rv.session.uuid=e.rv.v.r_1.uuid ' create session variable
            e.url="target.a5w" ' page redirect

            Now to handle the grid filter on the target page, set an argument in the grid to be a session variable and filter the grid on that argument.
            Bob Moore


            Comment


              #7
              Re: Open 2nd modal Grid after new record

              Originally posted by Bob Moore View Post
              e.rv.session.uuid=e.rv.v.r_1.uuid ' create session variable
              e.url="target.a5w" ' page redirect

              Now to handle the grid filter on the target page, set an argument in the grid to be a session variable and filter the grid on that argument.
              Bob,

              What I fail to understand, how is uuid different than autoincrement? IOWs, where does uuid get set? If it is set in the table, isn't that the same problem as autoinc? Or do you set it as a calc field in the grid itself? Even that requires a trip to the server. I'm missing something here?
              Peter
              AlphaBase Solutions, LLC

              [email protected]
              https://www.alphabasesolutions.com


              Comment


                #8
                Re: Open 2nd modal Grid after new record

                Originally posted by bea2701 View Post
                After insert record returns the key from the database put that in a session var and open the other grid. By using LAST it is not 100% that it is your key unless your app is single user.
                Is there a command to close the grid itself? If I can get the value using AfterInsert, close the grid automatically and open the 2nd grid filtered on the value, I'm in business.
                Peter
                AlphaBase Solutions, LLC

                [email protected]
                https://www.alphabasesolutions.com


                Comment


                  #9
                  Re: Open 2nd modal Grid after new record

                  Latest release subject: about GRID refresh [row] should do the job

                  Comment


                    #10
                    Re: Open 2nd modal Grid after new record

                    In V10, use the initial value property. This will set the value on the client side, prior to submission to the server.

                    http://screencast.com/t/7jffQY0k
                    Last edited by Bob Moore; 11-01-2009, 11:03 AM.
                    Bob Moore


                    Comment


                      #11
                      Re: Open 2nd modal Grid after new record

                      Originally posted by Bob Moore View Post
                      In V10, use the initial value property. This will set the value on the client side, prior to submission to the server.

                      http://screencast.com/t/7jffQY0k
                      Bob,

                      Thanks. Seems to good to be true. Strictly speaking, that's not possible. api_uuidcreate() is an xbasic function, so it has to fire on the server side. But maybe, if I understand you, it fires that server side, returns it to the grid, and then submits the grid to the server/table write. Is that what is happening?
                      Peter
                      AlphaBase Solutions, LLC

                      [email protected]
                      https://www.alphabasesolutions.com


                      Comment


                        #12
                        Re: Open 2nd modal Grid after new record

                        In this situations i filter the second grid using the table max or dB max functions and in the filtre part of the funcions i just filter by the user, i normaly put tht filtring code in the a5w page not the grid itself, IT works perfectly in v 9 but havent tried it on versi�n 10
                        Cheers
                        Mauricio

                        Comment


                          #13
                          Re: Open 2nd modal Grid after new record

                          Maurico,

                          Thanks. Interesting method. Of course, I would prefer to use the grid itself, rather than a page. Think Tabbed_Ui.
                          Peter
                          AlphaBase Solutions, LLC

                          [email protected]
                          https://www.alphabasesolutions.com


                          Comment


                            #14
                            Re: Open 2nd modal Grid after new record

                            I dont think that table max or dB max would work in the grid filter but you can try
                            another option would be to filter the grid by user and order r�cords inversly by record number and set the properties to only show 1 r�cord. Easy but not as clean because the r�cord navigator Will be there
                            Cheers
                            Mauricio

                            Comment


                              #15
                              Re: Open 2nd modal Grid after new record

                              Peter,

                              Sorry, poor explanation on my part. I was thinking along the lines of the database server (SQL).

                              Obviously the xbasic function, api_uuidcreate() is running on the Alpha WAS and the value is being set prior to the display of the row, most likely in something like the OnInitialValueCalculate event.

                              If you wanted to you could choose not enter the initial value as a property and add the following to the OnInitialValueCalculate event : e.newValues.uuid=api_uuidcreate().

                              So you can run xbasic in any of the server side events and of course javascript on any of the client side events. You can also write an ajax callback to run an xbasic script that can return a javascript object and/or return the javascript or html code to run on the client. V10 offers some amazing capabilities once you get the hang of it!
                              Bob Moore


                              Comment

                              Working...
                              X