Expand my Community achievements bar.

SOLVED

Problem with full event seems like a bug

Avatar

Level 2

Hi,

I had a requirement like this, there are two text fields say Textfield1 and Textfield2 and if Textfield1 is full it should automatically go to textfield2 and fill the characters typed from the keyboard. I  had implemented this by using full event. If  Textfield1 is full change focus to Textfield2.

Now I have come across very strange issue i.e., the last character that I enter in Textfield1 is not going to Textfield2. Its because full event is triggered at the key in of the last character.

Tried other alternatives didnt work.

Guys, Now I dont understand is this correct. Anybody came across the same issue.

Thanks for all you do.

1 Accepted Solution

Avatar

Correct answer by
Level 2

Yes I used this script

xfa.host.setFocus("TextField2");   in my full event. However I was able to resolve the issue by using newText and limiting the length to 50.

Now I come across a different issue i.e., it doesnt work if I enter all uppercase letters in the TextField1.

Reason being the characters count differ for uppercase and lowercase. Not sure how to handle this.

Also, I expect full event can be a solution in this case, however If I use full event and change the focus to new textfield the last key stroke gets lost.

Any help on this would be highly appreciated..

View solution in original post

2 Replies

Avatar

Level 7

Can you provide your script that you're using? Are you limiting the keystrokes in the script or in the object settings, or are you limiting to the visible area? The reason I ask is that this script limits the number of keystrokes, and forces the focus to the next field so that the final keystroke is not lost.


if (xfa.event.newText.toString().length >= 5) xfa.host.setFocus("TextField2");


Avatar

Correct answer by
Level 2

Yes I used this script

xfa.host.setFocus("TextField2");   in my full event. However I was able to resolve the issue by using newText and limiting the length to 50.

Now I come across a different issue i.e., it doesnt work if I enter all uppercase letters in the TextField1.

Reason being the characters count differ for uppercase and lowercase. Not sure how to handle this.

Also, I expect full event can be a solution in this case, however If I use full event and change the focus to new textfield the last key stroke gets lost.

Any help on this would be highly appreciated..