# \[FEATURE\] focusOrder property for mobile 'forms'?

**URL:** <https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207>\
**Category:** Ignition Early Access\
**Created:** [October 16, 2018, 9:33pm UTC](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207 "2018-10-16T21:33:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [October 16, 2018, 9:33pm UTC](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207/1 "2018-10-16T21:33:42Z")

</div>

With the old mobile module, it was difficult to create a form that would automatically move from field to field as they were populated.

Can we get some better control for how to move from one field to another when a form is being populated without needing the user to touch each input field?

For example, someone scanning in a raw component label with multiple barcodes, have it go from inputBox1 to inputBox2 based on the property for focusOrder

Pre-8.0.0 Ignition

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [October 17, 2018, 12:02am UTC](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207/2 "2018-10-17T00:02:57Z")

</div>

Interesting. How would one field know it’s done receiving input, and that it’s time to move to the next field?

---

<div class="post-metadata">

**Author:** ![TruThat](https://avatars.discourse-cdn.com/v4/letter/t/ea666f/32.png) [@TruThat](https://forum.inductiveautomation.com/u/TruThat)\
**Post date:** [October 17, 2018, 12:29am UTC](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207/3 "2018-10-17T00:29:10Z")

</div>

Tab or Enter at other apps work?

---

<div class="post-metadata">

**Author:** ![whitson.brandon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/whitson.brandon/32/79016_2.png) [@whitson.brandon](https://forum.inductiveautomation.com/u/whitson.brandon)\
**Post date:** [October 17, 2018, 12:41am UTC](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207/4 "2018-10-17T00:41:31Z")

</div>

I can imagine a preset length. 13 character UPC or date for example. After being fulled the input box would know to move on...

---

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [October 17, 2018, 1:15pm UTC](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207/5 "2018-10-17T13:15:11Z")

</div>

One method could possibly be that after scanning, input = input+CRLF, then using the keyEvent to see when the CRLF “happens” it would then move on to the next in “line” of the focusOrder.

---

<div class="post-metadata">

**Author:** ![ryanjmclaughlin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryanjmclaughlin/32/4318_2.png) [@ryanjmclaughlin](https://forum.inductiveautomation.com/u/ryanjmclaughlin)\
**Post date:** [October 17, 2018, 1:21pm UTC](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207/6 "2018-10-17T13:21:28Z")

</div>

> [@TruThat](#):
>
> Tab or Enter at other apps work?

If tab/enter are the only worries than their should not be an issue as this would be the native behavior of the browser. The only important part would be ensuring that Perspective allows us to define the tab order of the fields so the browser can advance in the correct sequence.

If we are talking barcode scanners.... You can program the scanner to append a tab/enter after the scan data. But, I would much rather have more control pragmatically over the input and just have a component where I can send the barcode scanner data via scripting to any field I want, give a lot more flexibility for more scenarios. See: [[FEATURE] better keyboard controls](http://forum.inductiveautomation.com/t/feature-better-keyboard-controls/20208)

---

<div class="post-metadata">

**Author:** ![whitson.brandon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/whitson.brandon/32/79016_2.png) [@whitson.brandon](https://forum.inductiveautomation.com/u/whitson.brandon)\
**Post date:** [October 17, 2018, 2:26pm UTC](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207/7 "2018-10-17T14:26:45Z")

</div>

> [@ryanjmclaughlin](#):
>
> But, I would much rather have more control pragmatically

Exactly what I was thinking. Not always will we have control over carriage return from a wedge scanner - Think phone camera - we won't be able to add a "return" when coming back from the image scanner.

---

<div class="post-metadata">

**Author:** ![PerryAJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/perryaj/32/3281_2.png) [@PerryAJ](https://forum.inductiveautomation.com/u/PerryAJ)\
**Post date:** [October 17, 2018, 3:41pm UTC](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207/8 "2018-10-17T15:41:37Z")

</div>

The order part is going to be pretty easy using `tabindex` properties on the input fields. I can’t think how we’d do the programmatic tabbing to next input is something right now, but it’s an idea worth investigating.

---

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [October 17, 2018, 6:27pm UTC](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207/9 "2018-10-17T18:27:00Z")

</div>

I used a Cognex MX-1502 scanning sled with an iPod touch in it (the Cognex sled works with iOS or Android devices).

One dimensional barcodes were in the 3 of 9 format, with 5 separate barcodes. Two dimensional barcodes in PDF417, but we have used data matrix also.

This is all in the old mobile module, obviously “translation/replacement" needed for 8.0/Perspective…

1. The old mobile module had the keyboard (separate from the browser keyboard) that would pop up when the text field gained focus, which I would have to manually minimize if I wanted to see what had happened behind it.

2. I also had to keep it as thin as possible, or I would get locked up. Each window had as few functions as possible and the scripts ran on the gateway

3. After the initial window, the operator hits one of the log in buttons

4. First, when the first log in window opens, there is a text field that uses the propertyChange event handler  
o if event.propertyName == ‘componentRunning’  
o looks at system.gui.getOpenedWindowNames()  
o if window == “Badge Screen”  
o system.gui.getWindow(“Badge Screen”).rootContainer.getComponent(“Text Field”).requestFocusInWindow()

5. Secondly, in the keyTyped event handler had the following  
CR = “\r”  
LF = “\n”  
RK = “\0”  
CRLF = ‘\r\n’  
if event.keyChar == CR or event.keyChar == LF or event.keyChar == RK or event.keyChar == CRLF:  
try:  
badge = event.source.text  
system.tag.write("[Client]badge", badge)  
system.nav.swapTo(“PW Screen”)  
system.nav.closeWindow(“Badge Screen”)

6. The Cognex scanning sled (MX-1502) takes the barcode scanned and can be configured to add a CRLF to the end of the scan.

7. I used this method for every window I needed a scan input for, with variation for what the next window needed to be

8. I could not use this for multiple text fields as the focus would return to the first one.

Another variation I had was, on some windows that I needed to scan to the same field over and over

1. I would have another component have a propertyChange event handler that would do the following
2. event.source.parent.getComponent(‘Label’).requestFocusInWindow()
3. then the text field re-requests focus and the existing text is highlighted.

Another was for the 2D (PDF417, but works with other 2D types) scan.

1. Behind the scenes it does parse for the 2D string and writes the values to tags.
2. Then writes the data to the database and shows the message

So I guess the feature improvement would be that I could scan all into one screen and have something like focusOrder() to allow me to set 1st, 2nd, 3rd, etc., etc. All without needing someone to touch the screen or a tab key (and no mouse attached to click) for each step.

Hmm, raises another question/suggestion: some kind of alpha-numeric scanInputBox component that would account for the above…?

---

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [November 12, 2018, 10:10pm UTC](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207/10 "2018-11-12T22:10:01Z")

</div>

In addition to this concept, for a purely non-keyboard type environment, we would need a way to trigger things happening. For example, onStartup of a view, trigger focus on the first input field, scan, trigger move to next input field, etc, etc…

---

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [November 13, 2018, 3:38pm UTC](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207/11 "2018-11-13T15:38:49Z")

</div>

These devices are for both indoor warehouse scanning and outdoor logistics/inventory moving. When outdoors, often in bad weather, these will need no hand entries if at all possible. Trying to type on a small screen in the winter with gloves on? Or summer storms? The sled provides the CRLF in addition to the scan, but I need a way to trigger focus without users having to touch the screen, especially for _multiple_ entries.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/dc5b4c5ce41a948f31c07cd0faf02d6988a1c91d.jpg) ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/ac4990fe889fcb032ab850147e8ffad3f8d8e193.jpg)

---

<div class="post-metadata">

**Author:** ![mrojas](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mrojas/32/6394_2.png) [@mrojas](https://forum.inductiveautomation.com/u/mrojas)\
**Post date:** [November 13, 2018, 5:06pm UTC](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207/12 "2018-11-13T17:06:26Z")

</div>

We’re working on a new component to help support barcode scanners. Currently, you don’t need any sort of focus and we intercept and append the scans to a data object on the component, which you can then consume. Would that functionality replace the need to go input field by input field?

---

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [November 13, 2018, 5:11pm UTC](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207/13 "2018-11-13T17:11:12Z")

</div>

So for example, you could show the user a message to scan something, then they scan, then you intercept that scan and possibly display the data that was scanned if desired?  
(Skip the “input field” all together?)

---

<div class="post-metadata">

**Author:** ![mrojas](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mrojas/32/6394_2.png) [@mrojas](https://forum.inductiveautomation.com/u/mrojas)\
**Post date:** [November 13, 2018, 5:24pm UTC](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207/14 "2018-11-13T17:24:15Z")

</div>

Yeah exactly. The scans just show up as a property on the component that you could then listen for changes.

---

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [November 13, 2018, 5:30pm UTC](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207/15 "2018-11-13T17:30:57Z")

</div>

That would vastly simplify my project… show message, listen for scan, put barcode value into the correct tag, show next message, listen for next scan, put next barcode in correct tag, “rinse and repeat” until complete… display all values scanned upon completion…

Speaking of, what would be the correct “client” location for those perspective tags so one device won’t “step on the toes” of another? Just in the All Providers/Default and each device will be a new instance of the tags? Or will this need to work more like the vision client style?

---

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [November 13, 2018, 5:46pm UTC](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207/16 "2018-11-13T17:46:23Z")

</div>

Will this also include the ability/props to designate which symbologies to listen for and ignore the rest?

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [November 13, 2018, 7:20pm UTC](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207/17 "2018-11-13T19:20:46Z")

</div>

> [@brian.mills](#):
>
> Speaking of, what would be the correct "client" location for those perspective tags so one device won't "step on the toes" of another?

For this, I'd put them in the `session.custom` properties, rather than tags.

---

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [November 13, 2018, 7:43pm UTC](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207/18 "2018-11-13T19:43:19Z")

</div>

And these would be values or arrays, but not objects, correct?

---

<div class="post-metadata">

**Author:** ![brian.mills](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian.mills/32/6348_2.png) [@brian.mills](https://forum.inductiveautomation.com/u/brian.mills)\
**Post date:** [November 13, 2018, 7:47pm UTC](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207/19 "2018-11-13T19:47:51Z")

</div>

Also, what would be the calls to read/write to the session.custom properties? (I am not seeing them in the 8.0, but I may have missed them…)

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [November 13, 2018, 8:00pm UTC](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207/20 "2018-11-13T20:00:36Z")

</div>

You can reference them from a script like this: `self.session.custom`

So for example you could do something like

> self.session.custom.foo = "bar"

[Next page](https://forum.inductiveautomation.com/t/feature-focusorder-property-for-mobile-forms/20207.md?page=2)
