How i can focus to current table in jsp

Posted on 2011-10-02
Last Modified: 2012-05-12
Hello experts,
In my jsp page, initially all tables are hidden. When clicked, those tables will get show.
The issue is, when a particular table is shown, the scroll bar is not focusing to the corresponding table. Instead it is focusing to the top of the page.

I used document.getElementById(tabId).focus();  in showHide() function of my code. But still it is not focusing to the table .

Please any ideas?

Question by:Alpita

    Expert Comment

    sory i dont know

    Author Comment

    I simplified the question. I have attached a simple html page which has 8 div tags.
    Lets say I clicked on div 8. it collapses. But it shows me the top of the page. Again I have to scroll down to see the collapsed div 8. If I click it (div 8) again, it will be expanded and automatically scroll to top of the page. I have to again scroll all the way down to see div 8.

    I tried several ways such as scrollToView(true), divX.scrollTop=0.

    My plat form is IE7 on Windows XP.

    Could you provide any solution for this issue. Myjsp.html

    Author Comment

    Could some one look into this problem. I made it easy to understand. You can download the attached html and see the issue on you system itself.

    Waiting for your quick reply.
    LVL 20

    Expert Comment

    by:chaitu chaitu
    you want focus in the table or in the cell of the table.any how send the HTML code.

    Accepted Solution

    I already attched my code in my previous comment.
    I found the solution for my issue.
    Need to add the statement "return false;" in <a> </a>.
    Like this:
    <a href="#" onClick="showHide('div2',2);return false;">div2</a>


    Author Closing Comment

    Found the solutin.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at (http://www.experts-ex…
    It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
    Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now