Expand my Community achievements bar.

Return results from custom dialog box not visibly updating field value

Avatar

Level 1

I have a form with custom dialog boxes (execDialog) for data entry. The dialog box is being called from the Entry event successfully. I also have it called from the Click event. So, here's what I get:

1. On entering the field, I get the dialog box pop up, I select a value, it visibly changes the field raw value and leaves focus in the field.

2. If I exit the field and re-enter, it also works as in point 1 (as expected)

3. If, while focus is already in the field, I click in the field, I get the dialog box, as expected, but after selecting a value from the dialog, the field raw value DOES NOT VISIBLY change until I exit the field! It's kind of like the click event is working in conjunction with the Exit event. This is totally counter-intuitive for a production form that is being designed for the general populace.

Anyone had any experience with this?

Cheers,

Marty.

1 Reply

Avatar

Level 1

Thom Parker answered this here: http://forums.adobe.com/message/2614570#2614570

Answer copied below:

"The problem is that when the focus is on the text box

it's in edit mode. It's only displaying the value interactively entered by

the user, or as a consequence of the change event.  What you need to do is

force the focus off of the text box in code.  You can do a little trick

where you bounce it to a tiny transparent field, which then bounds the focus

back so it doesn't look like the focus changed."

What I ended up doing was calling up the dialog box, then using setfocus with no parameters to remove focus from the field, as follows:

this.rawValue = this.dialogBoxFunction(this.rawValue); // passing current value so dialog box defaults to that value

xfa.host.setFocus();

Cheers,

Marty.