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

Submitting a parent grid from a child

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

    Submitting a parent grid from a child

    I need to submit the information entered into a parent grid from a child grid. From the documentation I entered into the inline javascript for a button on the child:


    GRID1_GridObj.submitdetailview();


    I am receiving the error "Object doesn't support this property."

    Help please.

    #2
    Re: Submitting a parent grid from a child

    Just a thought, but - is your parent grid really named GRID1?

    Thanks,

    Robert
    Earl Allin
    REAInc.net

    We can help you with mentoring and custom programming services in Alpha, .NET, React, PHP, ColdFusion, and more..

    Comment


      #3
      Re: Submitting a parent grid from a child

      Great question. I actually have thought that was part of the problem. I tried using the grid name instead of GRID1 with no success. I see that I am supposed to use the grid alias. Is there an easy way to determine what a linked grid's alias is - and potentially change it to something simple? (BTW, I did test this by changing the name to GRID2 and got a different error message "GRID2_gridobject not recognized." So, I do think GRID1 is somehow the default alias. How am I doing?)
      Last edited by newtothe5; 08-26-2010, 03:03 PM.

      Comment


        #4
        Re: Submitting a parent grid from a child

        I never figured out how to determine the parent grid name using Xbasic, however, if you publish the webpage, and view the source, you'll be able to see what it is.

        I think you're doing good for a new user :-)

        Thanks,

        Robert
        Earl Allin
        REAInc.net

        We can help you with mentoring and custom programming services in Alpha, .NET, React, PHP, ColdFusion, and more..

        Comment


          #5
          Re: Submitting a parent grid from a child

          Thanks Robert,

          Great suggestion on the view source. Sure enough, the alias was set by A5 as GRID1. But the GRID1_GridObj.submitdetailview(); Still won't psot the data entered into that child grid.



          Originally posted by workaholic06 View Post
          I never figured out how to determine the parent grid name using Xbasic, however, if you publish the webpage, and view the source, you'll be able to see what it is.

          I think you're doing good for a new user :-)

          Thanks,

          Robert
          Last edited by newtothe5; 08-26-2010, 08:02 PM.

          Comment


            #6
            Re: Submitting a parent grid from a child

            Originally posted by newtothe5 View Post
            I need to submit the information entered into a parent grid from a child grid. From the documentation I entered into the inline javascript for a button on the child:


            GRID1_GridObj.submitdetailview();


            I am receiving the error "Object doesn't support this property."

            Help please.
            you never want to use a hard coded alias name in your javascript because the grid alias might not be 'GRID1'.

            if you want to cause the parent grid to submit when a button in a child grid is pressed then you need javascript like this:


            Code:
            var po = {grid.Object}.getParentObject();
            po.submitDetailView();
            the {grid.object} placeholder will get replaced at runtime with the actual grid object name. so if the grid alias at runtime is GRIDX then {grid.object}, will be replaced with 'GRIDX_GridObj' which would be the correct object name of the child grid.

            the first line of code gets a pointer to the child grid's parent object.

            then, once you have a pointer to the child grid's parent object, you can call that grid's .submitDetailView() method.

            note that javascript is case sensitive. so the method MUST be spelled as '.submitDetailView()' (in your example, you had the case wrong).

            Comment


              #7
              Re: Submitting a parent grid from a child

              Can't you just pass the value back to the parent grid in a variable?

              Comment


                #8
                Now, in reverse

                Excellent Selwyn, Thanks for the great suggestions. That will work for some situations I have. Already has. However, I need to also execute from a master grid with multiple childs. How do I capture an alias or variable that uniquely identifies each child grid like the "var po" for the one parent object?

                Originally posted by Selwyn Rabins View Post
                you never want to use a hard coded alias name in your javascript because the grid alias might not be 'GRID1'.

                if you want to cause the parent grid to submit when a button in a child grid is pressed then you need javascript like this:


                Code:
                var po = {grid.Object}.getParentObject();
                po.submitDetailView();
                the {grid.object} placeholder will get replaced at runtime with the actual grid object name. so if the grid alias at runtime is GRIDX then {grid.object}, will be replaced with 'GRIDX_GridObj' which would be the correct object name of the child grid.

                the first line of code gets a pointer to the child grid's parent object.

                then, once you have a pointer to the child grid's parent object, you can call that grid's .submitDetailView() method.

                note that javascript is case sensitive. so the method MUST be spelled as '.submitDetailView()' (in your example, you had the case wrong).

                Comment


                  #9
                  Re: Now, in reverse

                  Originally posted by newtothe5 View Post
                  Excellent Selwyn, Thanks for the great suggestions. That will work for some situations I have. Already has. However, I need to also execute from a master grid with multiple childs. How do I capture an alias or variable that uniquely identifies each child grid like the "var po" for the one parent object?
                  that's a good question. unfortunately, there is no property in the Grid object that tells you the aliases of all of its child grid objects.

                  so you have to come up with your own solution.

                  here is an example.

                  say you have a grid called 'parent1' and it has two child grids 'child1' and 'child2'.

                  inside the onGridRender system event for 'child1' you could add this javascript:

                  Code:
                  window['childgrid1'] = '{grid.object}';
                  then for 'child2', add this code in the onGridRender event:

                  Code:
                  window['childgrid2'] = '{grid.object}';

                  now, in the parent Grid you have the name of its child grids in the two javascript variables, 'childgrid1' and 'childrid2'.

                  if you want to execute a method of childgrid1, you would do something like this

                  Code:
                  var cmd = window['childgrid1'] + '.refresh();'
                  eval(cmd)

                  Comment


                    #10
                    Re: Now, in reverse

                    Thanks again Selwyn, except your wrong that I have to come with my own solution. You came up with it for me! Works flawlessly on the first child. One last question on this(probably). What variables are available for multiple child grid assignments? I know I saw something on alphapedia that would help with this including declaring variables. But, that site is down now and I am just too excited about finishing off this project to wait.

                    Originally posted by Selwyn Rabins View Post
                    that's a good question. unfortunately, there is no property in the Grid object that tells you the aliases of all of its child grid objects.

                    so you have to come up with your own solution.

                    here is an example.

                    say you have a grid called 'parent1' and it has two child grids 'child1' and 'child2'.

                    inside the onGridRender system event for 'child1' you could add this javascript:

                    Code:
                    window['childgrid1'] = '{grid.object}';
                    then for 'child2', add this code in the onGridRender event:

                    Code:
                    window['childgrid2'] = '{grid.object}';

                    now, in the parent Grid you have the name of its child grids in the two javascript variables, 'childgrid1' and 'childrid2'.

                    if you want to execute a method of childgrid1, you would do something like this

                    Code:
                    var cmd = window['childgrid1'] + '.refresh();'
                    eval(cmd)

                    Comment


                      #11
                      Re: Submitting a parent grid from a child

                      I don't think I understand your question.

                      The technique I describe here can be used for multiple child grids.
                      Each child grid just creates a unique variable name to hold its object name.

                      So, if you have two child grids and you want a button on the parent that is going to refresh both child grids, you would write:

                      Code:
                      var cmd = '';
                      cmd = cmd + window['childgrid1'] + '.refresh();';
                      cmd = cmd + window['childgrid2'] + '.refresh();';
                      eval(cmd)

                      Comment


                        #12
                        Re: Submitting a parent grid from a child

                        Selwyn,

                        I ended up solving the problem a little differently then you suggested and its working great. I write it here so 1) you can tell me if its a bad idea for stability and 2) because it might help others with a similar situation.

                        I needed the button on the master grid to perform several fuctions on multiple childs with the order of the function executions being crucial. So,

                        1) I used your code and placed it in one action javascript event.

                        var cmd = window['childgrid1'] + '.refresh();'
                        eval(cmd)

                        2)I then repeated that code for the next function

                        var cmd = window['childgrid2'] + '.submitDetailView();'
                        eval(cmd)

                        and so on for several other functions.

                        This has made development, and future changes, much easier because now I can just move the action script events up or down to change the firing order rather then trying to get a long complicated string of functions entered correctly for each trial and error firing order test.

                        Anyway, thanks for the help, tell me if you think this structure is solid long term and I think we can put this one squarely in the resolved column.


                        Originally posted by Selwyn Rabins View Post
                        I don't think I understand your question.

                        The technique I describe here can be used for multiple child grids.
                        Each child grid just creates a unique variable name to hold its object name.

                        So, if you have two child grids and you want a button on the parent that is going to refresh both child grids, you would write:

                        Code:
                        var cmd = '';
                        cmd = cmd + window['childgrid1'] + '.refresh();';
                        cmd = cmd + window['childgrid2'] + '.refresh();';
                        eval(cmd)

                        Comment


                          #13
                          Re: Submitting a parent grid from a child

                          what you have done sounds fine, but one thing you need to be aware of (you probably are already aware of this, but i'll mention it anyway). ajax callbacks are asynchronous.

                          that means that if you call two commands that both do a callback (and the .refresh() and .submitDetailView() are definitely examples of commands that do callbacks), then the second command you call will execute before the first command has actually completed.

                          for example if you first call the .refresh() method, then the .sbumitDetailView() method, then what happens is this:

                          1. javascript fires off an ajax callback to do a refresh()
                          2. the javascript then continues executing and immediately does a .submitDetailView(), which fires off a second ajax callback.
                          at this point the first ajax callback (the .refresh() has likely NOT yet completed). eventually, it will complete and it will send back its response (in the form of some javascript for the browser to execute).

                          but keep in mind that it is quite possible that the .submitDetailView() command will send back its response to the browser before the .refresh() method does, even though it was called second.

                          Comment


                            #14
                            Re: Submitting a parent grid from a child

                            Interesting. I'm glad I asked the stability question. If one string is uised with one eval(cmd) for the functions, is the result different with the second callback waiting for the first to complete? If so, is there a way to pause the execution between callbacks?

                            Originally posted by Selwyn Rabins View Post
                            what you have done sounds fine, but one thing you need to be aware of (you probably are already aware of this, but i'll mention it anyway). ajax callbacks are asynchronous.

                            that means that if you call two commands that both do a callback (and the .refresh() and .submitDetailView() are definitely examples of commands that do callbacks), then the second command you call will execute before the first command has actually completed.

                            for example if you first call the .refresh() method, then the .sbumitDetailView() method, then what happens is this:

                            1. javascript fires off an ajax callback to do a refresh()
                            2. the javascript then continues executing and immediately does a .submitDetailView(), which fires off a second ajax callback.
                            at this point the first ajax callback (the .refresh() has likely NOT yet completed). eventually, it will complete and it will send back its response (in the form of some javascript for the browser to execute).

                            but keep in mind that it is quite possible that the .submitDetailView() command will send back its response to the browser before the .refresh() method does, even though it was called second.

                            Comment


                              #15
                              Re: Submitting a parent grid from a child

                              Originally posted by newtothe5 View Post
                              Interesting. I'm glad I asked the stability question. If one string is uised with one eval(cmd) for the functions, is the result different with the second callback waiting for the first to complete? If so, is there a way to pause the execution between callbacks?

                              no, you can't pause execution between callbacks. you have to think differently when coding asynchronous events.

                              if the first event you do is a detailViewSubmit, then you have to go to the afterDetailViewSubmit client side system event and define an event handler here that invokes the next action in your chain of events.

                              Comment

                              Working...
                              X