Expand my Community achievements bar.

setFocus() problem

Avatar

Level 2

Hi All,

I have a probelm that I cannot setFocus to an object (a Listbox) from the click event.
I set the setFocus() inside the click event of a drop down list so that when I click on the drop down list, it will disappear and show the listbox instead, and also focus into the listbox.

the fact is the exit event of drop down list can be triggered, but the enter event of list box cannot...
does anyone have any ideas about it?

thankssss~~~~


here is the event script of the drop down list:

<event activity="click" name="event__click">
<script>

DropDownList.presence = "invisible"
ListBox.presence = "visible"

xfa.host.setFocus(ListBox)

</script>
</event>

1 Reply

Avatar

Former Community Member

I think click event of your dropdown is causing some problem. Also, it may be conflicting with your actual functioanlity.

Try to write your code in the change event of your dropdown. That should work smoothly.

Regards,

Chaitanya