9 Replies Latest reply on May 7, 2008 8:48 AM by ilya_shaikovsky

    IE 6 focus problem

    rainw

      Hi,

      I use focus of a4j:commandButton to set focus on the field which have an error by rerender.

      <a4j:commandButton value="#{bean.value}"
       id="submitButton"
       type="submit"
       reRender="main_content"
       ajaxSingle="true"
       focus="#{bean.getErrorField}"
       action="#{bean.submit}">
       </a4j:commandButton>


        • 1. Re: IE 6 focus problem
          rainw

          Sorry, have had problems with connection.

          What I would say was that with FF it works fine. But IE 6 doesn't work for this since I have upgraded to release 3.2.0 GA.
          Did you know this or is there a reason I don't no?

          Thanks.

          • 2. Re: IE 6 focus problem
            rainw

            Have nobody the same problem or is there no answer for this?

            • 3. Re: IE 6 focus problem
              rainw

              I have looked in older versions of my app and i have seen that this have never worked on IE 6, so that it is no problem of the new release.
              In IE 7 it doesn't work too!

              I have try to set focus in different ways, but in IE nothing worked.

              focus="form:id"
              focus="id"
              focus="#{getFocus}" public String getFocus() { return clientId; }

              • 4. Re: IE 6 focus problem
                ronanker

                try something like oncomplete="jQuery(element).focus()"...

                i've never tryed to do that...

                • 5. Re: IE 6 focus problem
                  ilya_shaikovsky

                  rainw, try a4j:log component. At the end of every request log there will be info about new focus setting. If there is any errors?

                  • 6. Re: IE 6 focus problem
                    rainw

                    Thanks for reply.
                    There is no error and it's all the same then the log from Firefox.

                    debug[17:23:15,689]: call selectSingleNode for id= _ajax:data
                    debug[17:23:15,861]: call selectSingleNode for id= _A4J.AJAX.focus
                    debug[17:23:15,861]: focus must be set to control form:HomeSavingNumbercheckDigit
                    debug[17:23:15,876]: Set focus to control
                    


                    I can't understand!
                    Can you tell me what IE do?

                    • 7. Re: IE 6 focus problem
                      rainw

                      Is there a special way for IE I have to implement?

                      • 8. Re: IE 6 focus problem
                        rainw

                        Hi,

                        can someone tell me why I didn't get an answer!?

                        Thanks.

                        • 9. Re: IE 6 focus problem
                          ilya_shaikovsky

                           

                          <h:panelGroup id="main_content">
                           <h:form id="myform">
                           <h:inputText id="myinput"/>
                          <a4j:commandButton value="click"
                           id="submitButton"
                           type="submit"
                           reRender="main_content"
                           focus="#{userBean.property}">
                           </a4j:commandButton> </h:form>
                           <br />
                          </h:panelGroup>


                          Because - I can't reproduce your issue using this code (the same you provided). Focus sets for me fine for IE7 and FF both