4 Replies Latest reply on Dec 17, 2009 10:16 AM by Markus Hofstettter

    <rich:editor> How to set Focus

    Markus Hofstettter Newbie

      Hello

       

      I am trying to set the Focus on a rich:editor element.The xhtml code looks like this:

       

      <a4j:form id="form">
      ...
      
        <rich:editor  id="editor" width="750" 
                      requiredMessage="#{msg['error.inputRequired']}"
                      validatorMessage="#{msg['error.toolong']}"
                      value="#{patientenJournalBean.neuerFreitextEintrag.text}"
                      configuration="richeditor-config" />
      
      <a4j:form/>
      
      ..
      <script>
                              document.getElementById('form:editor').focus();
       </script>
      

       

      This does not work however. I belive this is related to the fact the the generated html code uses the id given to the <rich:editor> tag for a <div> element that is placed around the editor. How can I set the focus on the input part of the <rich:editor>