# On Enter focus to next numeric entry view in perspective table

**URL:** <https://forum.inductiveautomation.com/t/on-enter-focus-to-next-numeric-entry-view-in-perspective-table/79640>\
**Category:** General Discussion\
**Tags:** perspective\
**Created:** [September 26, 2023, 12:36pm UTC](https://forum.inductiveautomation.com/t/on-enter-focus-to-next-numeric-entry-view-in-perspective-table/79640 "2023-09-26T12:36:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![vignesh\_H](https://avatars.discourse-cdn.com/v4/letter/v/f475e1/32.png) [@vignesh\_H](https://forum.inductiveautomation.com/u/vignesh_H)\
**Post date:** [September 26, 2023, 12:36pm UTC](https://forum.inductiveautomation.com/t/on-enter-focus-to-next-numeric-entry-view-in-perspective-table/79640/1 "2023-09-26T12:36:12Z")

</div>

![Numeric entry](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/6/06a8a512d2511d5af2c7f01d2334aa738de77982.png)

Actually am using the Numeric Entry Field. My requirement is if I type the values and if I press enter button the cursor need to go next available Entry Field, in this case need to create the script

---

<div class="post-metadata">

**Author:** ![grietveld](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/grietveld/32/6984_2.png) [@grietveld](https://forum.inductiveautomation.com/u/grietveld)\
**Post date:** [September 26, 2023, 12:42pm UTC](https://forum.inductiveautomation.com/t/on-enter-focus-to-next-numeric-entry-view-in-perspective-table/79640/2 "2023-09-26T12:42:55Z")

</div>

If its always going to be the same order, you should be able to do a change script on the value of the first numeric entry field and then assign focus to the next one using the path to the component and .focus

[https://docs.inductiveautomation.com/display/DOC81/Perspective+Component+Methods#PerspectiveComponentMethods-RequestingFocus](https://docs.inductiveautomation.com/display/DOC81/Perspective+Component+Methods#PerspectiveComponentMethods-RequestingFocus)

---

<div class="post-metadata">

**Author:** ![CalebM](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@CalebM](https://forum.inductiveautomation.com/u/CalebM)\
**Post date:** [September 26, 2023, 12:52pm UTC](https://forum.inductiveautomation.com/t/on-enter-focus-to-next-numeric-entry-view-in-perspective-table/79640/3 "2023-09-26T12:52:16Z")

</div>

You could also put it on the onActionPerformed component event. It seems to work like you would want it to.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [September 26, 2023, 1:08pm UTC](https://forum.inductiveautomation.com/t/on-enter-focus-to-next-numeric-entry-view-in-perspective-table/79640/4 "2023-09-26T13:08:34Z")

</div>

Tip: use the question title to summarise what the question is _about_. e.g. "How to switch focus to next text field on pressing Enter?"  
Ask the question in the body of the post.

---

<div class="post-metadata">

**Author:** ![vignesh\_H](https://avatars.discourse-cdn.com/v4/letter/v/f475e1/32.png) [@vignesh\_H](https://forum.inductiveautomation.com/u/vignesh_H)\
**Post date:** [September 26, 2023, 3:07pm UTC](https://forum.inductiveautomation.com/t/on-enter-focus-to-next-numeric-entry-view-in-perspective-table/79640/5 "2023-09-26T15:07:52Z")

</div>

Thanks for your reply,  
Actually it is perspective table, I have added a render view (Numeric Entry for a column)

---

<div class="post-metadata">

**Author:** ![CalebM](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@CalebM](https://forum.inductiveautomation.com/u/CalebM)\
**Post date:** [September 26, 2023, 3:31pm UTC](https://forum.inductiveautomation.com/t/on-enter-focus-to-next-numeric-entry-view-in-perspective-table/79640/6 "2023-09-26T15:31:00Z")

</div>

You could probably use a message handler. Each of the rendered view would need to know their row number. When the text is submitted it sends a message to all the rendered views with a payload of the next row number. Each rendered view checks if their row number matches the next row and if so set the focus to their numeric entry.

---

<div class="post-metadata">

**Author:** ![Dharani\_T](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@Dharani\_T](https://forum.inductiveautomation.com/u/Dharani_T)\
**Post date:** [September 27, 2023, 1:16pm UTC](https://forum.inductiveautomation.com/t/on-enter-focus-to-next-numeric-entry-view-in-perspective-table/79640/7 "2023-09-27T13:16:00Z")

</div>

I have created a similar setup and tried the same and its working.  
Please follow the same and let me know,

- Create a param named rowIndex and custom param focus to the numeric entry view.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/a/ba848828263c30a7ef20826cad7261efc22264ad.png)

- Create a message handler in table view  

- On value change script of num entry value,

```auto
	rowIndex = self.view.params.rowIndex + 1
	payload ={'rowIndex':rowIndex}
	system.perspective.sendMessage("update-row", payload, scope = 'page' )

```

- Create another message handler in num entry field,  

- On value change script of selectedRow in table,

```auto
	payload ={'row':currentValue.value}
	system.perspective.sendMessage("focus", payload, scope = 'page' )

```

---

<div class="post-metadata">

**Author:** ![vignesh\_H](https://avatars.discourse-cdn.com/v4/letter/v/f475e1/32.png) [@vignesh\_H](https://forum.inductiveautomation.com/u/vignesh_H)\
**Post date:** [October 10, 2023, 10:38am UTC](https://forum.inductiveautomation.com/t/on-enter-focus-to-next-numeric-entry-view-in-perspective-table/79640/8 "2023-10-10T10:38:46Z")

</div>

Its working perfectly thanks all.
