Solved

Navigating to the content on the same page

Posted on 2009-04-01
8
154 Views
Last Modified: 2013-11-24
I have a JSF page which is very lengthy. I have some links at the top of the page. If the user selects a link, the correspondinf content has to be displayed which is located on the same page. How can I implement this?

Similarly, How to implement "Go to Top" or "Go to Bottom" in the same page?

What JSF related tag should I use to achieve this? (as like <a> tag in html)
0
Comment
Question by:Kadhiravan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
8 Comments
 
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 220 total points
ID: 24036759
<a name="top">This is top</a>

<a href="#bottom">Go to bottom</a>

<a href="#otherpart">Go to other part</a>
.
.
..
<a name="otherpart">Here is other part</a>


.
.

<a name="bottom">This is bottom</a>

<a href="#top">Go to top</a>

It is called an anchor
0
 
LVL 13

Assisted Solution

by:qwerty021600
qwerty021600 earned 30 total points
ID: 24036937
This can be achieved using Named Anchor to the hyperlink.
<a name="z" id="z"></a>
0
 
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 220 total points
ID: 24037006
erm... and this comment expands on what I already said in what way?
0
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 220 total points
ID: 24037013
PS: If you want javascript, you can do

<a href="#" onClick="window.scrollTo(0,0); return false">Top</a>

and
<a href="#" onClick="document.getElementById('someId').scrollIntoView(); return false">scroll to someId</a>
0
 

Author Comment

by:Kadhiravan
ID: 24037445
Hi,  Thanks for your response. Can you please let me know how this can be done in JSF page as we not supposed to use HTML tags in JSF page (constructed using JSF and Tomahawk tags.).
0
 
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 220 total points
ID: 24037957
One way:

http://www.horstmann.com/corejsf/jsf-tags.html#Table4_18

<h:outputLink value="#conclusion" title="Go to the         conclusion"> <h:outputText value="Conclusion"/>         </h:outputLink>


0
 

Author Closing Comment

by:Kadhiravan
ID: 31565209
I got the page scroll working fine. Thanks for your help.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 24061210
And why a "B" ?
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to implement Singleton Design Pattern in Java.
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

695 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