How to set focus on the ace editor?-open source projects ajaxorg/ace

I am using the ace editor component from ajax.org inside a jquery tab interface. Each tab will contain a separate ace editor. Whenever I switch to a new tab, the editor in it won’t get the focus.

I can detect when a tab is selected by binding to the “tabsshow” event of jquery UI. Does any one know how to set focus to the editor in it if say the id of my editor div is editor-tab-0 for the first tab, and so on…?

Please can some one help?