These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Setting Focus() to a desired field of a table in an expandable Livecycle Designer forms

agautam
Registered: Jul 8 2011
Posts: 2
Answered

This is what I am trying to accomplish:
 
1. There is an expandable Livecycle Designer form
2. One of the form field ("itemName") in this form is filled when a scanner scans a barcode
3. As soon as the item is scanned, two actions happen in the form
a. All the other related fields in this form are calculated/populated
b. An line is added at the end of this form to scan the next item.
 
Challenges I am seeking answer for:
 
1. When the item is already scanned, the cursor in the form should focus to the itemName field in the newly added line. This is needed as every time an item is scanned, the user will not have to set focus manually (using tab or mouse).
2. Second challenge is that the length of the barcode is not fixed, so a 'full' functionality of the form action can not be used.
3. Third challenge is that the form registers every entry of individual barcode digit (for one scan) as a change. This makes it hard to use change functionality of the forms as a viable option. (Example: while reading barcode 12345, the form registers five different changes (should be one)).
 
Everything else has been taken care of in this application, except setting right focus. Any help with set focus will be deeply appreciated. Thanks.

AG

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Accepted Answer
Have you tried using the setFocus function in the Initialize event for the field you want focused? If this doesn't work try setting the focus in the Initialize event for repeated subform, or in a sibling field.

I haven't used any of the barcode capabilities of Acrobat so I don't know the answers to your other questions.


Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

agautam
Registered: Jul 8 2011
Posts: 2
Thank you so much Thomp, the idea worked perfectly.
Everytime I would scan an item, a row would be added. I called the event at field initialization and set the focus using script "xfa.host.setFocus(this.ItemName);". This worked perfectly as the new row now have the cursor at desired location, so the the person just have to scan-scan-scan with no using of mouse or tab.

Thank you again,

AG

AG