0 Replies Latest reply on Jul 31, 2008 12:02 PM by bigevilfish

    Setting the focus of an input box after a reRender

    bigevilfish

      Hi,

      We have an input box inside a modal window, on keyup we are calling a spring webflow action which re-renders the page with new values.

      What we also need to-do is set the focus to that of the input box, at the moment I'm trying this code but although the reRender is called and the content is updated by spring the focus is not set, any suggestions?

      <h:inputText id="searchTxt" value="#{bookingSearchModel.advertiserSearchString}" maxlength="30" onkeyup="javascript: detectEvent(event,'doPopupAdvertiserSearch');" />
      
      <a4j:jsFunction name="doPopupAdvertiserSearch" reRender="#{flowRenderFragments}" action="doPopupAdvertiserSearch" oncomplete="document.getElementById('popupAdvertiserForm:searchTxt').focus();"/>