On Enter focus to next numeric entry view in perspective table

Numeric entry

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

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

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

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.

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

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.

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

  • Create a message handler in table view

  • On value change script of num entry value,

	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,

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

Its working perfectly thanks all.