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

Recent Problems with onChange events...urgent help needed

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

    Recent Problems with onChange events...urgent help needed

    Hello all,

    In short, I have recently ran into an issue where the below code does not seem to trigger when assigned to an onChange event on another field

    When I put this exact code into a button or trigger based on any other means than onChange it works fine, but when I put into onChange event it does not fire.

    Again, the objective is to have the fields listed below get updated with user information anytime this other field is updated. I really feel it has something to do with latest build because this exact code is still working in production apps that I have not published any updates over the last couple months.


    **Please help as this is the last stage of a significant update I'm trying to roll out in coming days but need to get past this.



    var name = {grid.Object}.__currentUserName;
    var d1 = new Date();
    d1 = d1.toFormat('MM/dd/yyyy 0h:0m:0s am');
    var name_stamp = name + ' ' + d1;

    {grid.object}.setValue('G', 'aStatusChangeUserID', {grid.RowNumber}, name);
    {grid.object}.setValue('G', 'aStatusChangeTimestamp', {grid.RowNumber}, d1);
    {grid.object}.setValue('G', 'aStatusChangeSignature', {grid.RowNumber}, name_stamp);


    Thank you, Casey

    #2
    Re: Recent Problems with onChange events...urgent help needed

    What type of control is it not working in? Is it all controls? (Because I have things in on-change on the current version that are working fine.)

    Comment


      #3
      Re: Recent Problems with onChange events...urgent help needed

      It is a text box within a grid.

      And yes, I have previous grids that used on change with no problems, but if I pull up in the most current build and try to preview or publish the same onChange does not work now....

      Are you on the most current build? If so, try to preview it as a live preview within Alpha dev software and see if still works??

      Let me know.

      Thanks

      Comment


        #4
        Re: Recent Problems with onChange events...urgent help needed

        What build are you using? What was your previous build? What type of Control do you have the onChange event set? Have you read the onChange notes?

        If you tab out of the control you're in (where this code is set for the onChange event) then the code fires and your other fields are updated.
        If you click out into another row then the grid doesn't really know where you are... and can't update. It's a timing thing. For a UX it's not that big a deal, unless you're working with a Repeating Section. For a Grid, you're dependent upon the row.

        You could put your code into the onKeyDown event. You're code will run more often... but... it's client-side so you won't feel a thing... and your Status fields will get updated.

        The notes for onChange talk about setTimeout. Try the suggestion of {noSetTimeout}... as in...

        Code:
        {noSetTimeout}
        var name = {grid.Object}.__currentUserName;
        var d1 = new Date();
        d1 = d1.toFormat('MM/dd/yyyy 0h:0m:0s am');
        var name_stamp = name + ' ' + d1;
        {grid.object}.setValue('G', 'aStatusChangeUserID', {grid.RowNumber}, name);
        {grid.object}.setValue('G', 'aStatusChangeTimestamp', {grid.RowNumber}, d1);
        {grid.object}.setValue('G', 'aStatusChangeSignature', {grid.RowNumber}, name_stamp);
        This will give you back the older behaviour.
        Last edited by Davidk; 03-10-2017, 11:36 PM.

        Comment


          #5
          Re: Recent Problems with onChange events...urgent help needed

          Thanks David. I tried to insert the noSetTimeout but was not sure exactly where to put it. I will try when I get back to my PC for sure.

          What i have always been able to accomplish was using as sort of a trigger. When a user changes the value in one field it actually updates adjacent fields with tracking like info.

          Like I said this code always worked in previous builds but now doing this.

          What sort of has be leaning towards a bug is that there is a grid that I made changes to other non related fields however a user the other day mentioned it was behaving differently (not updating additional fields based on onChange. At the time was puzzling because I never touched the code, now I realized because I republished the grid because of something else now did not work with current build??

          Again, I'm definitely going to try the noTimeOut code at top of code and see. I really hope this makes it behave as before....

          Thanks again!

          -Casey

          Comment


            #6
            Re: Recent Problems with onChange events...urgent help needed

            Just tried and did not work....

            So strange because the same code works on onKeyPress, onBlur, onSelect, etc......the problem is that for the functionality needed I truly need this javascript to be triggered by onChange....

            Any additional ideas welcome...

            Thanks again David,,

            -Casey

            Comment


              #7
              Re: Recent Problems with onChange events...urgent help needed

              Sorry, forgot to mention in my last post. I'm on Version 12.4.3.2, Build 4119.....System addins - Build 4825

              Comment


                #8
                Re: Recent Problems with onChange events...urgent help needed

                This works for me under 4119. I added fields to my table to match your status fields... and... with the {noSetTimeout} in place, the fields are updated by the onChange event code as soon as I leave the Textbox control I've attached the code to... no matter how I leave that control. There must be something else going on with your Grid... or your process. The onKey events are essentially "change" events. What's special about the onChange event that it must be used. Any Javascript errors generated?

                Comment


                  #9
                  Re: Recent Problems with onChange events...urgent help needed

                  Thank you David for taking the time on this on a Friday night :), I truly appreciate it

                  Wow, interesting. Well, we are getting somewhere then....

                  I still think there is a problem with my {noSetTimeout} code because the text color stays black, as if there is something wrong with it....is that normal?

                  Attached is a screenshot of how I have it nested in the onChange coding...

                  Screenshot_031017.doc

                  Comment


                    #10
                    Re: Recent Problems with onChange events...urgent help needed

                    It's just code that's being interpreted by Alpha... they're testing for {noSetTimeout}.

                    If you click into another control on the same row... the code doesn't fire? If you put an alert('test'); in your code... you don't get the alert?

                    Comment


                      #11
                      Re: Recent Problems with onChange events...urgent help needed

                      Yes, I tried the alert code and it brings back alert fine...

                      I was also thinking it must have been something with grid to I created a brand new grid with same coding and just cannot seem to update other fields based on the change of the "source" field....

                      Like I said, so odd that I use this "triggering" accross many apps and historically have always, and still do, it is just now when I try to implement in this new build getting this issue.

                      The fact that yours works is even stranger.....

                      So you are putting in same location as "text" code?

                      No errors.

                      Comment


                        #12
                        Re: Recent Problems with onChange events...urgent help needed

                        So you are putting in same location as "text" code?
                        Not sure what this means... could you explain?

                        You'd have to post the Grid and a sample table dump with a few records. Otherwise it's all just guessing.

                        Comment


                          #13
                          Re: Recent Problems with onChange events...urgent help needed

                          I hear you David. My apologies. It is definitely hard to describe in words my issue....

                          I will try to prepare something tomorrow to post.

                          In the meantime Would you maybe be able to provide a screenshot of where exactly you are placing this same code that is working for you?

                          Comment


                            #14
                            Re: Recent Problems with onChange events...urgent help needed

                            Sure, but I'm not sure why that might help. onChange event of a Textbox Control. It really feels like there is some missing information here.

                            GridOnChange.PNG

                            Comment


                              #15
                              Re: Recent Problems with onChange events...urgent help needed

                              Thanks David, honestly I'm intentially taking this approach because I actually recreated a brand new grid from scratch with no other coding and just these fields and still experienced the same issue.

                              If possible can you forward your grid complement that is working and let me try to import into my project and see if I still have the issue?

                              Thanks again.

                              Comment

                              Working...
                              X