Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8651635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:07:12+00:00 2026-06-12T14:07:12+00:00

I am using JSF 1.2 and Richfaces 3.3.3 in my sample JSF Application. I

  • 0
I am using JSF 1.2 and  Richfaces 3.3.3 in my sample JSF  Application.

  I have a form with  rich:dataTable that having single column  with h:inputText and footer having  a4j:commandButton  with value "add".

  when I click "add" button  then new row adding in  rich:dataTable and that is working fine.
  My need is after pressing "add" button the focus have to go newly created row to  the    h:inputText   field...


  sample code :

 <rich:dataTable  value="" var="">
    <rich:column>
        <f:facet name="header">
           <h:outputText value="name" />
        </f:facet>
                  <h:inputText id="name" value="#{obj.name}">
         </rich:column>

    <f:facet name="footer">
        <a4j:commandButton value="add"  action="{actionMethod}" />
    </f:facet>
</rich:dataTable>

when I click “add” button then new row adding in rich:dataTable and that is working fine.
My need is after pressing “add” button the focus have to go newly created row to the h:inputText field…

How to do this using JQuery or java script, any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:07:13+00:00Added an answer on June 12, 2026 at 2:07 pm

    Please find below the javascript for setting focus.

    function setFocus() {
                var displayedRowsCountValue = document
                        .getElementById("exampleManageBean:displayedRowsCountValue").value;
    
                var firstRowIndexValue = document
                        .getElementById("exampleManageBean:firstRowIndexValueId").value;
                displayedRowsCountValue = parseInt(firstRowIndexValue - 1)
                        + parseInt(displayedRowsCountValue);
                for (i = parseInt(firstRowIndexValue - 1); i < parseInt(displayedRowsCountValue); i++) {
                    var tmpComponent = "selectedId[" + i + "]";
                    var temp = (document.getElementsByName(tmpComponent)[1]);
                    if (temp != null && temp.checked == true) {
                        var temp1 = document
                                .getElementById("exampleManageBean:exampleTable:"
                                        + i + ":exampleTextBox");
                                temp1.focus();
    
                            }   
                        }
                }
    

    The displayedRowsCountValue & firstRowIndexValueId should be taken from t:dataScroller

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using JSF 1.2 with Richfaces and Facelets. I have an application with many
I have an enterprise application written in JAVA with JSF (using RichFaces 3.3). Currently
I'm using JSF 2.1 with RichFaces 4 and I have a form with a
I'm using JSF and RichFaces 4. I have a huge form which I have
I'm using richFaces 3.3 and JSF 1.2. In my sample application I need to
I am using JSF 1.2 and Richfaces 3.3.FINAL. I have an inputText which must
I'm working on an application using JSF 2.0 and Richfaces 4, that consists of
Using Richfaces 3.3.0GA, jsf 1.2_14 and facelets. I have a richfaces ModalPanel with an
I'd like to be able to make an Ajax call using JSF/Seam/RichFaces and have
Im working in a web application using JSF 2 and richFaces 4 and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.