jquery - Programmatically change focus in blackberry webworks application -


i working on developing webworks app uses jquery's "show" , "hide" methods dynamically change page contents.

the application loads page few text inputs jquery styled hyperlink button. focus on start page defined x-blackberry-initialfocus attribute.

when 1 of hyperlink buttons selected jquery hides displayed text inputs , buttons, , shows different set of text inputs , hyperlink buttons. @ point, focus navigation breaks , appears no element has focus.

i have tried adding permissions use blackberry.focus config.xml , executing " blackberry.focus.setfocus('my_text_input_id'), " did not have effect.

i guaranteed call setfocus executed after desired html element added dom putting call setfocus in jquery show method's callback function. used jquery select desired text input before calling setfocus ensure element existant.

additionally, called blackberry.focus.getfocus() before , after calling setfocus() , getfocus() method returned empty string on each call.

does know why can't seem regain focus?

i had same problem.

i found blackberry.focus.setfocus("element"); had not effect, if click in element make show/hide effect once more, code work fine.

then solution use settimeout:

settimeout(function(){    blackberry.focus.setfocus("show_menu"); },100); 

it works good.

i hope helps solve problem


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -