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

Find dialog loses focus

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

    Find dialog loses focus

    Not understanding why focus is lost in the following situation.

    I want to click on a button on the Main Menu to open a form, then begin with a find dialog on the form.

    I put the following actions in the OnPush event of the Main Menu Order Entry button:

    Close current form (i.e., close the Main Menu)
    Open Form to open the order entry form
    I already have a button on the order entry form to find by company name, so the next action is to use the short cut key, Contol-Y, to bring up the find dialogue.
    In this case, it is the following:

    :orders:button4.activate()
    sys_send_keys("{^Y}")

    Regardless of the different ways there are to bring up the find dialogue, it always comes up out of focus. That is, I either need to press Enter or click in the find box to gain focus.

    Control-Y or clicking on the find by customer button will always give focus to the find dialogue, but I can't get focus on it when coming in from the Main Menu.

    Any ideas?

    Thanks.

    Jeff

    #2
    Re: Find dialog loses focus

    Are you trying to run the script on your find company button, without pushing the button?

    Comment


      #3
      Re: Find dialog loses focus

      Originally posted by Tom Cone Jr View Post
      Are you trying to run the script on your find company button, without pushing the button?
      Yes, that's right. The idea is when the user leaves the Main Menu and arrives at the order entry screen with a find dialog, the user can start to type the name of the company to find rather than first having to click in the find dialog or press the enter key. I can't get the find dialog to achieve focus; rather, it's grayed out upon arrival.

      Jeff

      Comment


        #4
        Re: Find dialog loses focus

        You might try a ui_yield() after opening the form and before you activate the button to be sure the form is finished loading. Or put your button pushing script into a function...?
        Robin

        Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

        Comment


          #5
          Re: Find dialog loses focus

          Do you get the same result with:

          Code:
          ':orders:button4.activate()
          'sys_send_keys("{^Y}")
          
          :orders.activate()
          :orders:button4.push()
          ???

          And, when moving from one form to another the action to close the current (calling) form is the last action in my script not my first.

          -- tom

          Comment


            #6
            Re: Find dialog loses focus

            Tom and Robin,

            I've tried each of the suggestions but nothing has succeeded. I do find that focus remains on the button that was pushed to bring up the find dialog. I could not find a way to activate the find dialog, i.e., I don't know how to refer to it by name. Do you know how to reference the find dialog object? If so, I think that activating this object would be the answer.

            By the way, the sys_send_keys is not really necessary, nor the :orders.activate(). It seems that the :orders:button4.push() is the only thing needed to bring up the find dialog. It's at that point when I want to shift the focus from the button to the dialog.

            Thanks.

            Jeff

            Comment


              #7
              Re: Find dialog loses focus

              No doubt about it. By activating another object after invoking the find dialog leaves the focus on that other object. So if I only knew how to reference the find dialog, I think the problem will be solved. I may try a send keys to a find dialog that waits for input, but better just to know how to reference the find dialog since the user should add the keys, not the program.

              Jeff

              Comment


                #8
                Re: Find dialog loses focus

                I seem to recall having the same trouble with the find dialog - and since it is a dialog, you can code your own. Instead I put a shared variable in similar locations on my forms, color it orange and fill it with a default value that clues the user as to the input data expected that works on the index for the form. Then I have a button next to it that allows the user to change the indexed field and find his record using a different key. That way the script does the find and fetches the record and leaves no dialog box to bring into focus. An alternative is to call an xdialog first where the user inputs the find data and let that dialog call the form.
                Attached Files
                Robin

                Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                Comment


                  #9
                  Re: Find dialog loses focus

                  Originally posted by MoGrace View Post
                  I seem to recall having the same trouble with the find dialog - and since it is a dialog, you can code your own. Instead I put a shared variable in similar locations on my forms, color it orange and fill it with a default value that clues the user as to the input data expected that works on the index for the form. Then I have a button next to it that allows the user to change the indexed field and find his record using a different key. That way the script does the find and fetches the record and leaves no dialog box to bring into focus. An alternative is to call an xdialog first where the user inputs the find data and let that dialog call the form.
                  I guess these might work, but it's a bit much to go through this to achieve what should be a simple result. I just don't understand why, when you click on a button on a form that results in a find dialog that retains focus, the same action under script control returns focus back to the button rather than keeping it on the find dialog. I've been scouring the xbasic reference to see what possible way there is to simulate the actions when clicking on the button, but nothing came up. I also could not find anything that suggests a name for the find dialog (so I can activate it at the end), or anything that would de-activate the previously pushed button.

                  Maybe it is not possible to achieve focus on the find dialog when invoked through code, and I wish I knew this for sure, for "what is a fact but the point at which we allow investigation to cease?". Here I am, continuing to investigate something that, in the end, just has a user clicking into the find dialog, not a big inconvenience. It would just be more professional and elegant to have it result in the same way that they would see if they were just clicking the button themselves. The quest goes on.

                  Jeff

                  Comment


                    #10
                    Re: Find dialog loses focus

                    Jeff,

                    Why not have the button on the calling form prompt the user for the desired value, and then open the form under script control that moves focus to the desired record?

                    Comment


                      #11
                      Re: Find dialog loses focus

                      Originally posted by Tom Cone Jr View Post
                      Jeff,

                      Why not have the button on the calling form prompt the user for the desired value, and then open the form under script control that moves focus to the desired record?
                      Maybe in the end I will need to do something like this. My starting point was not knowing why I could not achieve focus with the built in find dialog. It's just one of those anomalies that I would like to solve if it is solvable. Maybe the answer to this will open up answers to similar situations. I'm looking more for the answer than the workaround.

                      Jeff

                      Comment


                        #12
                        Re: Find dialog loses focus

                        Ok, let us know what you discover.

                        Comment


                          #13
                          Re: Find dialog loses focus

                          Originally posted by Tom Cone Jr View Post
                          Jeff,

                          Why not have the button on the calling form prompt the user for the desired value, and then open the form under script control that moves focus to the desired record?
                          I guess there's a point at which you need to fish or cut bait. I think I'll do what you suggest. I already tested it and it works.

                          The sequence is as follows, for anyone interested in the same:

                          1. Set the index you want to use (in this case, by customer name).
                          2. Prompt for text and store result in a variable.
                          3. If the variable is not blank, do a find by key using the variable.

                          The prompt for text keeps the focus while the built-in find dialogs do not. Go figure.

                          Thanks for your help.

                          Jeff

                          Comment


                            #14
                            Re: Find dialog loses focus

                            Originally posted by Tom Cone Jr View Post
                            Ok, let us know what you discover.
                            My final version of this is all set. I formatted the prompt for text to look more like the find dialog. One additional thing I did, though, is not to have this "special" button be usable other than as its use on first coming in to the order entry screen. So I removed it as a tab stop and hid it and disabled it, which works. I wasn't sure whether there would be a downside to using a button which has a find by key using "another form" while in the "current form" that is the same.

                            If anyone discovers or knows how I could have achieved focus using the built-in find dialogs, I am all ears. Thanks.

                            Jeff

                            Comment


                              #15
                              Re: Find dialog loses focus

                              I'm missing something here. Why are you using Ctrl-Y to open the Find dialog? Isn't the Find opened with Ctrl-K?

                              I've been using sys_send_keys( "{^K}" ) ever since Alpha "fixed" the way the Find dialog works so that now it doesn't have focus when opened with a "standard" .find action.

                              (FWIW: I don't think they really intended to "fix" anything. I think it just happened and they've never been willing to take the time to fix it. I know it was reported as a bug a long time ago. It worked fine in some earlier versions of A5 and maybe they finally fixed it in v11 but I don't have v11 yet since none of my customers are using or current need v11.)

                              Comment

                              Working...
                              X