Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

How do I set focus to a text field after I click a button that calls a webservice?

Avatar

Level 1

I have a web service that returns back a table. In order to show the values in the table I had to check the re-merge Form Data on the Webservice Button.  My question is , How do I set focus to a field on the screen after re-merge happens.

2 Replies

Avatar

Level 8

On the layout ready set the focus to the desired field

Avatar

Level 1

I was reading SetFocus documentation and it says

 

You cannot use 

setFocus with the form:ready, layout:ready, or initialize events.

What I need is an event like doc:ready or someother event where I can put the set focus code in. doc:ready was triggered when the form first loads which is great and I was able to put my Initial setfocus. When I pressed the button that calls the webservice and thr re-merge happened doc:ready event was not triggered so now I am not sure where to put the set focus.