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 save the data from an Unbound Grid

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

    #16
    Re: How do I save the data from an Unbound Grid

    Originally posted by GGandhi View Post
    A.H.

    yes it does in my program every day.
    i check to see if an item exist and then alert that item can not be added, or it adds one
    and both times i get a message.
    i modified my code to fit his.
    I'll have to try it myself then. I was thinking that your way would save the use of one more variable. I think the only problem would be when you want to add more stuff to the variable.
    I'm guessing that
    Code:
      addConsequence =  addConsequence + "some more stuff"
    Wouldn't work right?
    So, if you only need it for an alert, your way is probably best, if you need it to execute some compiled script, then maybe not.

    Originally posted by GGandhi View Post
    i will read your code that seems well written.
    I stole ideas from a lot of people on the forum to write it....LOL

    Comment


      #17
      Re: How do I save the data from an Unbound Grid

      jINX TRIED THAT BUT STILL NO ALERT SHOWS UP - I was wondering if something is turned off.

      Comment


        #18
        Re: How do I save the data from an Unbound Grid

        Could be something with Javascript being turned off, yeah. It's a javascript popup alert. Try an a5 message box instead. I'll see if I can find the code quick.

        Comment


          #19
          Re: How do I save the data from an Unbound Grid

          okay i read your code.
          you are using one super if to start and end and process all in between. i have few if and endif. you must be a big programmer, i am not.
          i do this as a hobby and learned all by myself, with the documentation alpha provided, you know exactly what that means.
          the added stuff in your code
          you name something as a message and then assigned that something back to the function name. i did not. i assigned the message directly to the function name.
          you provided additional message what was wrong with failure to connect, execute whatever. i simply opted for a message. no additional info.
          is yours better? may be.
          mine suits me well and has served well
          i do not know how to add smileys
          that will not be my handicap.
          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


            #20
            Re: How do I save the data from an Unbound Grid

            Try this in place of the alerts:
            Code:
            vjscmd = "A5.msgBox.show('Message Title','<div style=`height: 1in; padding: 15pt;`>Record successfully inserted!</div>',[{html: 'OK', value: 'ok'}],function(button) {if(button == 'ok') {setTimeout(function() {},10)}});"
            
            
            vjscmd = "A5.msgBox.show('Message Title','<div style=`height: 1in; padding: 15pt;`>Execute Error: Error returned was: " + js_escape(cn.CallResult.text) + "</div>',[{html: 'OK', value: 'ok'}],function(button) {if(button == 'ok') {setTimeout(function() {},10)}});"
            
            vjscmd = "A5.msgBox.show('Message Title','<div style=`height: 1in; padding: 15pt;`>Connection Error: Error returned was: " + js_escape(cn.CallResult.text) + "</div>',[{html: 'OK', value: 'ok'}],function(button) {if(button == 'ok') {setTimeout(function() {},10)}});"
            You can change the title to whatever you'd like with these as well....I think they also should be a work-around for a popup blocker.
            Last edited by -Jinx-; 03-08-2013, 07:48 PM.

            Comment


              #21
              Re: How do I save the data from an Unbound Grid

              Originally posted by GGandhi View Post
              okay i read your code.
              you are using one super if to start and end and process all in between. i have few if and endif. you must be a big programmer, i am not.
              i do this as a hobby and learned all by myself, with the documentation alpha provided, you know exactly what that means.
              the added stuff in your code
              you name something as a message and then assigned that something back to the function name. i did not. i assigned the message directly to the function name.
              you provided additional message what was wrong with failure to connect, execute whatever. i simply opted for a message. no additional info.
              is yours better? may be.
              mine suits me well and has served well
              i do not know how to add smileys
              that will not be my handicap.
              I learned all by myself too from reading endless documentation but mostly from people on this forum. I just started coding Xbasic a few months ago. I'm actually a Manufacturing Engineer by trade and have more experience coding for CNC machines and robots.

              You taught me something new today with how you did your alerts and I'm going to try it myself.

              I try to write code as clean and small as possible and your way of doing the alerts may be the way to go.

              Thanks!

              P.S. adding the cn.callresult is VERY helpful when you have to try to figure out why there's an error. Also you can use cn.callresult.rowsaffected to see how many records you've changed., also very helpful
              Last edited by -Jinx-; 03-08-2013, 07:47 PM.

              Comment


                #22
                Re: How do I save the data from an Unbound Grid

                mmmmm till no message with the new code

                Comment


                  #23
                  Re: How do I save the data from an Unbound Grid

                  WIERD......... Have you tried a different browser? I'm guessing your right about some settings being turned off. Do you have any problems with any other javascript running properly through alpha? If you just add a new button and put nothing but a javascript alert in it, does it work?

                  Comment


                    #24
                    Re: How do I save the data from an Unbound Grid

                    I am relatively new to Alpha xBasic, but been programming mostly with VFP and VB.NET for several years and in my opinion both code are pretty good and deliver the expected result, I am used to object oriented programming and prefer JinX way of coding shown here, but coding is very personal to each developer or hobbyist and Govindan doing this as a hobby, it is a pretty darn clear code to me.

                    There is a constant learning in this profession and I always learn something from the forums.
                    Edhy Rijo
                    Progytech
                    (Computer Consultants)
                    The makers of CardTracking.Net
                    www.progytech.com

                    Comment


                      #25
                      Re: How do I save the data from an Unbound Grid

                      Have found the issue

                      The default function name for the onclick event is function serverside_0c4059c580604f94b8e343e0e18738d9 and we were using addConsequence for the error message.

                      When I change the function to be called addconsequence i GET AN ERROR MESSAGE SAYING serverside_0c4059c580604f94b8e343e0e18738d9 CANNOT BE FOUND

                      Comment


                        #26
                        Re: How do I save the data from an Unbound Grid

                        Huh?
                        where is that function serverside_blahblah coming from? That looks like serverside xbasic that came from clicking on the "Server-side Xbasic" button in your button's onclick event and then accidently saving it. Toast that stuff. Get rid of your onClick event. Then:
                        1. Go back to your buttons properties and click on "onClick"
                        2. "Add New Action"
                        3. "Ajax Callback"
                        4. Select the callback type as "internalXbasicFunction"
                        5. Put your function name in "addConsequence"
                        6. Click ok and save, your done, since you should already have the function defined in your Xbasic functions.

                        Comment


                          #27
                          Re: How do I save the data from an Unbound Grid

                          Edhy Rijo

                          thanks, appreciate your comments.
                          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


                            #28
                            Re: How do I save the data from an Unbound Grid

                            chris

                            i have added a check to see if the record exists and if so it just updates that record as opposed to creating a new one, so you should have only one record.
                            please check the code, i did not test it. so look for any typographical errors, please.
                            few thinking: see any one can apply to you.

                            the whole function can be applied to on change event of the consequence field (which is radio button) if that works well for you then you can remove the button
                            totally so every time the teacher changes the field it will automatically submit the record no need to click another button. less work when many students are naughtier.

                            instead inserting and updating another record you can just update the main table and create a report based on the class_id and person_id so you can see how they behave with different teachers.
                            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


                              #29
                              Re: How do I save the data from an Unbound Grid

                              Gandi

                              Thanks for the reply and youe work that has helped me so much.

                              I have added the above function as an xbasic function and I keep getting this error.

                              Error executing Ajax callback function 'addConsequence' Error reported was: command: person_id = e._currentRowDataNew.person_id Property not found
                              e._currentRowDataNew.person_id subelement not found.

                              Any Ideas.

                              Thanks

                              Chris

                              Comment


                                #30
                                Re: How do I save the data from an Unbound Grid

                                Also,

                                If the Update was to be done this way (Which I like) the Selection Check Query Would be different as I would have to check to see if it had happened just in that lesson. I need to collect the Current Teacher Credentials which is the email address which is set in an Argument called USER and the Lesson which are known as periods and are names P1, P2, P3, P4 and P5.

                                Chris

                                Comment

                                Working...
                                X