0 Replies Latest reply on Apr 8, 2011 3:40 AM by ram ram

    Focus problem when reRender

    ram ram Newbie

      Hello All,


      I have a reRender problem with two <rich:combo>, one for countries and the second for states. so when i select a country i reRender the states combo in order to get the related data. The problem is the first time i enter the page i select the country combo (without changing its value) and navigate to the other combo using "tab" (noting that the two combos have consecutive tabindex) the cursor appears in the states combo and then disappear. if i repeat the action again the case is no longer reproduced. below is my code:



      <rich:comboBox suggestionValues="#{baseBean.countryNames}" value="#{baseBean.selectedCountryName}" id="countryName" required="true"                        requiredMessage="#{multiLangageBB.translation.valueRequired}"  directInputSuggestions="true"  width="200px" tabindex="3">

                  <a4j:support event="onchange" ajaxSingle="true" action="#{baseBean.getRelatedStateLst}" reRender="stateName"/>



      <rich:comboBox suggestionValues="#{baseBean.stateNames}" value="#{baseBean.selectedStateName}" id="stateName" required="#                                         {baseBean.stateRequired}" requiredMessage="#{multiLangageBB.translation.valueRequired}" directInputSuggestions="true" defaultLabel="#                       {multiLangageBB.translation.defaultLabelState}"  width="200px" tabindex="4" >



      Here is some observations, The first time i select (set focus on) the countries' combo without changing value and i press "tab button"  the focus should be set on the states combo but the combo is refreshed (when reRender) and the focus is lost. if i repeat the action again the state combo is selected and the cursor remains in the state combo.


      anybody has an idea how to overcome this case.


      Thanks in advance,