2 Replies Latest reply on Jun 4, 2012 8:27 AM by jimfeuerstein

    Issue with onLayoutKeystroke in Go

    jimfeuerstein

      I am simulating a quick find using a global text field in the header to accept the user's search term. When the user hits the return key, the search is executed.

       

      I'm using an onLayoutKeystroke script to watch for the return key. The script is simple -- if it detects the return key, it calls a search script; otherwise it exits and lets the user add another character into the global field.

       

      The mechanism works fine in Pro. It also works fine in Go -- but only when it's used in Form view.

       

      In List view in Go, after the onLayoutKeystroke script runs, the cursor fails to return to the global field and the keyed character fails to appear. The iOS keyboard stays available and the field remains highlighted.

       

      I have to click "next" or tap the global field -- then the character appears, the cursor reappears, and I can enter another character.

       

      Can someone suggest what I may be missing that's causing the List view failure in Go? For what it's worth, there are no other enterable fields on the layout and no tabs are set, other than for the global field itself.

       

      Jim Feuerstein

      Magellan's Law Corporation

      www.litigationbestpractices.com

        • 1. Re: Issue with onLayoutKeystroke in Go
          jbante

          Can you post a screenshot of your script? That may help folks diagnose the issue.

           

          Also, why are you using OnLayoutKeystroke instead of OnObjectKeystroke? I don't know that using one vs. the other would change the behavior you're experiencing, but OnObjectKeystroke might provide less "interference" if you ever want to use the same script on a layout with more enterable fields.

          • 2. Re: Issue with onLayoutKeystroke in Go
            jimfeuerstein

            In answer to your question, I should have posted this as an inquiry regarding onObjectKeystroke. That was how the mechanism was originally defined. I had changed it to onLayoutKeystroke as part of my many attempts to debug. It behaves the same way in onObjectKeystroke.

             

            However, your request that I post the script led to a solution to my problem.

             

            Before posting the script, I thought I should look at it to see if there was any extraneous code I should remove (for example, I have standard header stuff in every script and, in this script, I have an IF / ELSE that determines which subscript to perform when the Return key is detected).

             

            Imagine my surprise when I noticed an unneeded "Freeze Window" step in the header. I apparently copied the header from another script and brought that step along as part of the copy.

             

            Anyhow, I removed that step and the script now functions as intended with onObjectKeystroke.

             

            Thanks for the reply!