[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How i can focus to current table in jsp

Posted on 2011-10-02
7
Medium Priority
?
204 Views
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?

Myjsp.txt
0
Comment
Question by:Alpita
  • 4
6 Comments
 

Expert Comment

by:davas
ID: 36899909
sory i dont know
0
 

Author Comment

by:Alpita
ID: 36901029
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
0
 

Author Comment

by:Alpita
ID: 36903257
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.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 20

Expert Comment

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

Accepted Solution

by:
Alpita earned 0 total points
ID: 36910647
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>

Thanks,
Alpita
0
 

Author Closing Comment

by:Alpita
ID: 37555644
Found the solutin.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
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 the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses
Course of the Month19 days, 18 hours left to enroll

872 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