2 Replies Latest reply on Sep 14, 2007 12:33 PM by lbbishop

    Setting cursor focus in text input field

      Can richfaces be used to set cursor focus in a form text input field?

      Specifically I need to set focus in a text field in a modal dialog. Do I use jsfFunction?

      Thanks in advance.

        • 1. Re: Setting cursor focus in text input field

          do you mean, to set it on Ajax response or not? If so, the attribute name is 'focus'. See tld on any Ajax component.
          If you mean something also, the solution depends on the situation.

          • 2. Re: Setting cursor focus in text input field

            I would like to set focus to a field named FieldName in a modal panel:

            <h:outputLink value="javascript:Richfaces.showModalPanel('customFieldDlg')">
             <h:outputText value="Add New Custom Field" styleClass="link-bold" />
             <a4j:support event="onclick" focus="FieldName" />
            </h:outputLink>
            


            But of course the modal panel is not rendered at the time the outputLink is clicked. So is there another way to set focus.