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

OnChange event activate object not working

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

    OnChange event activate object not working

    I just ran across some strange behavior that I believe is not working as it should be. Before I submit a bug report, can somebody please verify for me that this is in fact incorrect behavior.

    The problem is when I try to activate a specific form field object that is on a tabbed object, Alpha skips the object I requested and moves to the next object instead. If you look really closely, it does appear to go to the object requested but immediately skips out of that form field object.

    I do not experience this behavior when using the .activate() in the OnChange event of a form field object that is NOT on a tabbed object. So this issue seems to be specific to form field objects that are located on a tabbed object.

    To duplicate, use the vendors form in AlphaSports. Create an OnChange event for the NAME form field object found on the Details tab, and place the following code:

    parentform:address_1.activate()

    Now open the form in view mode, mouse to the name field, change the name and press enter. The new field that gets focus is the address_2 and not address_1. If you watch closely enough, you should see it go to address_1 but then immediately move on to the next object on the form that has a tab stop.

    I am currently setting focus in my code to go to the object before the one I actually need, so I have a work around. However, this seems to be incorrect behavior to me and before I submit a bug report, I would prefer to get other opinions that this behavior is in fact incorrect.
    Cheryl
    #1 Designs By Pagecrazy
    http://pagecrazy.com/

    #2
    Re: OnChange event activate object not working

    Cheryl,

    I don't think a bug report will do much good if you truly meant to be in the Version 7 forum. But if you meant version 8, let me know and will try to reproduce your findings....later on.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________



    Comment


      #3
      Re: OnChange event activate object not working

      Hi Mike,

      I did mean for V7, and although you are probably correct, it can't hurt for me to try. You never know :) But I still don't like to do it unless I am sure.
      Cheryl
      #1 Designs By Pagecrazy
      http://pagecrazy.com/

      Comment


        #4
        Re: OnChange event activate object not working

        Cheryl

        In Version 7 and in Version 8 the focus jumps to the address 2 field. edit: I can confirm what you are seeing in your post.

        It should work, however, pressing the enter key after changing the name field will take you to the address 1 field with an on change event.

        I created another form in Alpha Sports based on vendor (no tabbed object) and placed code in the on change eent for name and it still reacts by bypassing the address1 field.

        As far as the tabbed object is concerned, I really do not use tabbed objects - in fact my current apps do not have a single tabbed object. I like to clutter the form with frames and browses. Since I don't use them often, I really not familiar with the behavior of tabbed forms, however, I did create another form based on vendors and it did not activate address_1 but skipped over to address 2.

        I don't know if it is a bug since the enter key by itself will take you to the next field - but it may be.

        Version 7 is really not being supported now so a bug report might not do anything -but it is doing the same in Version 8 - so a bug report might get some interest.

        Try posting on the version 8 forum or as google say "feeling lucky" and submit a bug report.

        Tom Baker
        Last edited by Tbaker; 12-03-2007, 11:40 PM. Reason: Forgot something

        Comment


          #5
          Re: OnChange event activate object not working

          Cheryl,

          I just tested in V5 and in V8--same thing--but why would you use this script when using tab stops already do the same thing?? I do not think it is a bug. When you activate the field and then press enter or tab it goes to the next tab--like it is supposed to. So it is like you are pressing enter/tab twice when you first activate and then use enter/tab.
          Mike
          __________________________________________
          It is only when we forget all our learning that we begin to know.
          It's not what you look at that matters, it's what you see.
          Henry David Thoreau
          __________________________________________



          Comment


            #6
            Re: OnChange event activate object not working

            Thanks for the input Tom and Mike. When I use an .activate() in an OnChange event of a form field object that is NOT on a tabbed object, I do not get the same behavior. Whether I press the tab or the enter key, the object that gets focus is the one that I have programmed in the OnChange event.

            When placed in an OnChange event of a form field object on a tabbed object, the object that gets focused is different than the one I have programmed. This is why I thought it may not be working as it should be since it acts differently than when programmed in an object off of the tabbed object.

            As far as, why would I do this anyway? I am conditionally programming which object gets focus based on the data entered in a particular object. I never noticed this in the past because I have never had the need to conditionally determine which object should get focus for the next data entry object on a tabbed form object.

            I do have a workaround, so I am quite certain that Alpha would not do anything about this for V7. Not to mention that I am probably the only one out there that actually uses and likes the tabbed objects :)

            Since you have verified similar behavior in V5 and V8, that tells me it has always been this way. So, maybe it is behaving the way it should be or that nobody has ever tried to use this before. Just seems strange that the same code performs differently based on the object it is placed in.
            Cheryl
            #1 Designs By Pagecrazy
            http://pagecrazy.com/

            Comment


              #7
              Re: OnChange event activate object not working

              The difference is the tab stop...remove it and it behaves the same. Notice that if you set it to activate a different field and not to one with the very next tab stop as you are doing that it behaves like you would want it to also.

              So maybe you could temporarily disable the tab stop and then enable it again after the activate???
              Mike
              __________________________________________
              It is only when we forget all our learning that we begin to know.
              It's not what you look at that matters, it's what you see.
              Henry David Thoreau
              __________________________________________



              Comment


                #8
                Re: OnChange event activate object not working

                I must have taken a stupid pill Mike because I have no idea what you just said :(
                Cheryl
                #1 Designs By Pagecrazy
                http://pagecrazy.com/

                Comment


                  #9
                  Re: OnChange event activate object not working

                  :D doubt it is you Cheryl!! Many a time I write things as I think them and I am the only one who knows the context!!

                  Said another way.

                  If the address_1 (in Alphasports per your example) tab stop is removed the parentform:address_1.activate() works just as in a non-tabbed form.

                  OR if any other field is activated instead of address_1 from the OnChange event of the Name field it works---

                  I hope this is a little bit clearer than mud... :)
                  Mike
                  __________________________________________
                  It is only when we forget all our learning that we begin to know.
                  It's not what you look at that matters, it's what you see.
                  Henry David Thoreau
                  __________________________________________



                  Comment


                    #10
                    Re: OnChange event activate object not working

                    Thanks Mike. That helps a little, my brain is really fried right now so I will have to re-read this again tomorrow when the fog has cleared.

                    I have a lot of tab stops set and not set selectively throughout the form for the 'standard' data entry practices. But since there are several conditions that change the 'standard' data entry sequence throughout the process, I thought a simple .activate() could get me where I want the user to be.

                    It still seems odd because you do NOT have to remove the tab stop when outside of the tabbed object for it to work :(
                    Cheryl
                    #1 Designs By Pagecrazy
                    http://pagecrazy.com/

                    Comment


                      #11
                      Re: OnChange event activate object not working

                      Cheryl,

                      I can feel your confusion even with the distance between us! And rightly so if your non-Tabbed form "works". When I use a non_tabbed form I get the same bypass of the next field as we get with a tabbed form---as does Tom.

                      So something else going on in your form as it is not acting like mine or Tom's...ours are consistant in giving the same bypass of field whether in a tabbed or non-tabbed form.
                      Mike
                      __________________________________________
                      It is only when we forget all our learning that we begin to know.
                      It's not what you look at that matters, it's what you see.
                      Henry David Thoreau
                      __________________________________________



                      Comment


                        #12
                        Re: OnChange event activate object not working

                        Cheryl,
                        and Mike and Tom

                        I also see the same behaviour in both v7 and v8. I also copied the three fields, name, address 1, and address 2 to the form (Vendor) itself (not on the tabbed object) and still see the same behaviour. (which is different to Cheryl's results but same as MIke's) You will probably find (I did) if you make a change to the name and then click some where else that the address_1 activates properly. Which hints toward the code working and maybe a timing issue with the tab or enter.

                        I think what is happening is the code is activating the object and then the enter or tab is still firing.

                        Mike, some of your testing came in while I was testing and writing this. I also tried removing tab stops but that just resulted in focus going back to the start of the tab order.(ie the tab label gets focus) Another slight difference to confuse things.

                        You could try putting the .activate code in the canArrive or onArrive events of the object next in the tab order. In the vendor form that would be Address_1. What ever value in Name that would normally result in address_1 being activated you could ignore because the normal tab sequence would apply. Test for your other values and activate the corresponding object. Because you have already used up the tab or enter to get to the field with the Canarrive event they will no longer be in play.

                        Try this in the canArrive event of Address_1 and then enter 'xxx" in the name field
                        Code:
                        If "xxx"$ Name.value then
                            parentform:address_2.activate()
                        end if
                        You could also add some other object to the form and camouflage it into the background to use as the holder of the canArrive event and make it next in the tab order.
                        Tim Kiebert
                        Eagle Creek Citrus
                        A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

                        Comment


                          #13
                          Re: OnChange event activate object not working

                          I believe I figured this out but need to go take care of some important errands. I will post my findings when I return :)
                          Cheryl
                          #1 Designs By Pagecrazy
                          http://pagecrazy.com/

                          Comment


                            #14
                            Re: OnChange event activate object not working

                            Sorry it took me so long to get back. The comments made by all forced me to go back and do some more reading of material I have not visited in a while and do more testing of my own. Here are my research findings.

                            My issues had nothing to do with the tabbed object. As stated by more than one of you, when following the same steps in an object that was not on a tabbed object, you were all getting the same behavior. I did NOT because I was not following my own exact steps. Mike had the key there as far as the tab stop being turned on or off. I truly thought the field I had set focus to had a tab stop turned on, but it did NOT. That is what happens when you try and troubleshoot something after your brain has already been fried :)

                            The .activate() in the OnChange event is acting exactly as Alpha has intended it to. My confusion came because I was using the 'tab' key and not the 'enter' key. Also mentioned by others in this thread. This is only effected if the object you are trying to set focus to has a tab stop set on it as Mike stated. So temporarily removing that tab stop and putting it back later would resolve that issue.

                            The OnDepart event is the event that needs to be used when you need to dynamically control the 'tab' stops using the tab key or the enter. I was trying to take a shortcut by using the OnChange because the only time that I THOUGHT I needed to control the tab stops was if there was a change in the data of a particular object.

                            What I was really trying to accomplish, if there was a change I needed to re-populate some form field object data with something different. Based on the values in particular form field objects I needed to control the next form field object that needed focus. The field that got focus needed to be done whether there was a change in the current form field object data or not. So one action had nothing to do with the other action.

                            I again THOUGHT I was taking a shortcut by simply adding my .activate() conditions at the same time I was populating form field object data.

                            Alpha was doing everything I was telling it to do. There is NO bug here, just a programmer with a fried brain that was not following her own good programming practices.

                            I resolved the issue by programming the proper events with the proper code and all works exactly as I need it to. Thanks to all for the comments that put my head back on straight, at least until the next time I mess up :)
                            Cheryl
                            #1 Designs By Pagecrazy
                            http://pagecrazy.com/

                            Comment

                            Working...
                            X