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 do I pass values to a New Record only grid form

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

  • How do I pass values to a New Record only grid form

    I have a desktop application built against dbf tables. I would like to create a WEB module for the application. The web side will use 4 grids. 2 Grids will use 2 tables for lookup information and the 3rd will be populated by values from the lookup grids along with data entered by the logged in user. The 4th grid is used to show the results. All grids will be displayed on a single WEB page.

    I have managed to create a log in and set session variables during the log in process. Using the session variables, I open the first grid filtered properly. When selecting the desired row in the first grid, I then open the second grid filtered on values from the first grid.

    I then want to open a 3rd grid as a enter only form to enter a new record using values from the 1st and 2nd grid, including values from hidden columns, along with additional data entered by the user.

    On the desktop side, I could use xbasic to do this. I don't have a clue how to do this on the WEB side. I don't know if I need to create arguments, session variables, client side or server side events, use java script, Ajax or what. I've been looking at some of the videos. While helpful in that I'm learning more about developing on the WEB side, I haven been able to learn how to do what I need.

    I've attached three pictures. The first is the desktop form. The second picture is where I am with the WEB page development.

    The first grid is filtered by the logged in user and available work orders. Selecting the desired work order opens another grid with the available discrepancy items for that work order. The item number on-click event opens the third grid, a form view enter only grid. I want the grid to display non-editable information from the first 2 grids to help the user verify his entry will be against the desired item number. Only the Date, hours and work done are to be entered by the user. However; when the Submit button is pressed, values from hidden fields will need to be written to that same table.

    NOTE: Although Item No shows a 1, that has been hard coded as a default temporarily.

    The last picture shows the fields in the table to which the grid is attached. Most of the hidden fields will need to have values entered when the submit button is pressed.

    I need to add a cancel button. I can add the button, but I do not know what code and where to attach to the button.

    I have been working with the desktop side for over 20 years. I'm having trouble trying to do the WEB side. Any help will be greatly appreciated.

    Ron
    Attached Files
    Alpha 5 Version 11
    AA Build 2999, Build 4269, Current Build
    DBF's and MySql
    Desktop, Web on the Desktop and WEB

    Ron Anusiewicz

  • #2
    Re: How do I pass values to a New Record only grid form

    OK you have set yourself a difficult task.

    You need to use javaScript to do what you want.

    I answered a similar question in a V12 forum.

    var rn = {Grid.RowNumber};

    this gets the row number of the selected row

    var item = {grid.Object}.getValue('G','ITEM',rn);

    cObj = Selwyn will help

    http://www.ajaxvideotutorials.com/V1...AndChild_1.swf
    http://www.ajaxvideotutorials.com/V1...AndChild_2.swf



    cObj.{grid.Object}.setValue('G','NAME',-1,name);


    This gives you the general idea.

    Michael

    Comment


    • #3
      Re: How do I pass values to a New Record only grid form

      Thank you Michael,

      Michael1954

      OK you have set yourself a difficult task.
      I know I have as I have minimal experience with this WEB stuff and I find it very frustrating compared to the desktop. To me what I want to do seems like a logical progression to what I want. I'm open to suggestions.

      Your reply and Selwyn's example was helpful. However; Selwyn's example is with a UX component. I'm dealing with 2 separate grids. Using the following code, I found it easy to capture field values from the second grid.

      Code:
      var rn = {Grid.RowNumber};
      var vcTransno = {grid.Object}.getValue('G','TRANSNO',rn);
      var vcSwkNo = {grid.Object}.getValue('G','SWKNO',rn);
      var vcItemNo = {grid.Object}.getValue('G','ITEMNO',rn);
      alert('Item No: '+vcItemNo+' Transno: ' + vcTransno+' SwkNo: ' +vcSwkNo);
      What's giving me trouble now is how to pass these variables to the third grid. I thought that these variables are session variables. But unlike session variables set when an a5w page is opened, I guess these session variables are tied to the second grid and the third grid doesn't know they exist?

      Maybe this would be better done with a UX component. It's just that I find them to be so confusing.

      Ron
      Alpha 5 Version 11
      AA Build 2999, Build 4269, Current Build
      DBF's and MySql
      Desktop, Web on the Desktop and WEB

      Ron Anusiewicz

      Comment


      • #4
        Re: How do I pass values to a New Record only grid form

        there is a video how to pass variables from one grid to another in version 11 videos, also i have posted a screencast about the same sometime ago.
        you can check the version 11 list, usually they are passed as window variable form the parent grid to the child grid or the child grid asking and identifying the parent grid.
        if you post your an example of your table structures and what you like then i can try over the weekend to show how that can be done.
        thanks for reading

        gandhi

        version 11 3381 - 4096
        mysql backend
        http://www.alphawebprogramming.blogspot.com
        [email protected]
        Skype:[email protected]
        1 914 924 5171

        Comment


        • #5
          Re: How do I pass values to a New Record only grid form

          I have recorded a video that shows how a similar thing can be achieved using the list control.

          I think you will find lists are the way to go in the UX.

          On the whole I use grids to build a means of editing displaying the database tables, but most things are achieved through the UX.

          It works on mobile where grids don't.

          https://www.youtube.com/watch?v=6cOpkrMxhlc

          Michael

          Comment


          • #6
            Re: How do I pass values to a New Record only grid form

            Hi Michael and thanks for the video.

            I don't think the list control is available in version 11. The closest that I could find is a drop box. However; for what I'm trying to do, the drop box may work. I will play with it some more.

            Gandhi, as much as I tried, I could not get the grids to pass the variables. Selwyn's function appears to me to be a built in function as his video shows many notations on how to use the function. For some reason, my version 11 does not have that function built in. Also, I'm not sure if it matters, but Selwyn's example has code referencing SQL and I'm working with DBF's.

            Anyways, I'm going to try again and if I can't make any headway, I may put something together for you to look at.

            Thanks,

            Ron
            Alpha 5 Version 11
            AA Build 2999, Build 4269, Current Build
            DBF's and MySql
            Desktop, Web on the Desktop and WEB

            Ron Anusiewicz

            Comment


            • #7
              Re: How do I pass values to a New Record only grid form

              I came across the video, M41, Setting Session variables when a child component is opened using action javascript.

              I thought that this would be what I was looking for to solve my problem. I followed Selwyn example to a tee, I think. Yes, it works, but only the first time through. What I mean is the session variable is set. But when I select a different row in the grid, the session variable is not written over to the new value.

              I set the session variable to the value of field 1 on row 1, say test1.
              This works.
              I go to field 1 on row 2 which should change the session variable to test2.
              The session variable still holds the value test1.

              I've tried this code in V11 and V12 with the same results.

              What am I missing?

              Ron
              Alpha 5 Version 11
              AA Build 2999, Build 4269, Current Build
              DBF's and MySql
              Desktop, Web on the Desktop and WEB

              Ron Anusiewicz

              Comment


              • #8
                Re: How do I pass values to a New Record only grid form

                Ok, I figured out what was wrong. The video does NOT apply to read only grids.
                Sooooo..

                I found another video, number 66. User-defined Ajax Callbacks - Understanding what Information is Available to you when you write your Xbasic Callback Handler

                Great, I said this is it. Again I followed the video and at first I thought I was good. But then I found that while viewing the grid, if I just clicked on the button, the session variable would not always be updated to the row that the button was on. So I would have to first click on the row and then click on the button.

                How would one write an enable expression for the button to only have it enabled for the current row in a grid. This would force the user to select the grid row first and then be able to press the button.

                TIA,

                Ron
                Alpha 5 Version 11
                AA Build 2999, Build 4269, Current Build
                DBF's and MySql
                Desktop, Web on the Desktop and WEB

                Ron Anusiewicz

                Comment


                • #9
                  Re: How do I pass values to a New Record only grid form

                  var selectedRow = {grid.object}.getSelectedRow();

                  You have the row number available in the grid for an enable/show hide

                  Michael

                  Comment


                  • #10
                    Re: How do I pass values to a New Record only grid form

                    you don't have to do all that
                    var selectedRow = {grid.object}.getSelectedRow();
                    as Michael suggested will give the data on any row and you pass that to another component via window object. this is from the parent to the child.
                    the child grid also can get the info from the parent once it got the parent object id then it can manipulate the data.
                    thanks for reading

                    gandhi

                    version 11 3381 - 4096
                    mysql backend
                    http://www.alphawebprogramming.blogspot.com
                    [email protected]
                    Skype:[email protected]
                    1 914 924 5171

                    Comment


                    • #11
                      Re: How do I pass values to a New Record only grid form

                      First, I'm not sure my approach is correct.
                      On top of that, I really don't know what I'm doing.
                      However; that said, I have made quite a bit of progress to this point.

                      Grid1(table1-Parent, read only) linked to Grid2(table2-Child, readonly) which opens UX Component Dialog form(table3-stand alone).

                      I hope I can say this right.
                      In one of the videos, Selwyn said that if the grid is read only, the only thing stored in the row is the primary key.
                      So, because my grids are read only, I need to do an Ajax callback so I can set session variables to fields in the current row of the grid.
                      Those session variables will be displayed on the UX form and then be used when the data entered in the UX component is submitted.
                      The UX component is bound to a completely different table than any of the grids.

                      That said, I kinda know what your talking about, but I don't quite get it.
                      I do really appreciate your help. I may need just a little more direction.

                      Thanks,

                      Ron
                      Alpha 5 Version 11
                      AA Build 2999, Build 4269, Current Build
                      DBF's and MySql
                      Desktop, Web on the Desktop and WEB

                      Ron Anusiewicz

                      Comment


                      • #12
                        Re: How do I pass values to a New Record only grid form

                        I made a simple screencast to show how the ux/dialog can get the parent object and the data from the parent object.
                        you can get the idea and add more data from the grand parent grid into the parent grid and then pass the data to the child dialog.
                        you can also do it via window object.
                        post back if you need more info or additional method.

                        http://screencast.com/t/9TJ8zCEWPKJ
                        thanks for reading

                        gandhi

                        version 11 3381 - 4096
                        mysql backend
                        http://www.alphawebprogramming.blogspot.com
                        [email protected]
                        Skype:[email protected]
                        1 914 924 5171

                        Comment


                        • #13
                          Re: How do I pass values to a New Record only grid form

                          here is another one, elaborate one indeed.
                          http://screencast.com/t/TENEFcrzLQHn
                          thanks for reading

                          gandhi

                          version 11 3381 - 4096
                          mysql backend
                          http://www.alphawebprogramming.blogspot.com
                          [email protected]
                          Skype:[email protected]
                          1 914 924 5171

                          Comment


                          • #14
                            Re: How do I pass values to a New Record only grid form

                            Gandhi,

                            Thank you so much for your help. I was away all day and was not able to do anything until this evening.

                            The parent and child grids are working fine for me. They work every time showing the selected record. What is giving me heartburn is when I call up the dialog from the second grid. I do not always get the correct information in the dialog.

                            At first I thought I found the problem. I had to un-check the box: Use cached Dialog Component. I thought that I fixed my problem, but 10% of the time, the dialog would open with the wrong or missing information.

                            Tomorrow I would like to try the window method.

                            Ron
                            Alpha 5 Version 11
                            AA Build 2999, Build 4269, Current Build
                            DBF's and MySql
                            Desktop, Web on the Desktop and WEB

                            Ron Anusiewicz

                            Comment


                            • #15
                              Re: How do I pass values to a New Record only grid form

                              if you still having problem post back a screencast or image, people can help you to get where you want to go.
                              thanks for reading

                              gandhi

                              version 11 3381 - 4096
                              mysql backend
                              http://www.alphawebprogramming.blogspot.com
                              [email protected]
                              Skype:[email protected]
                              1 914 924 5171

                              Comment

                              Working...
                              X