Solved

Navigating to the content on the same page

Posted on 2009-04-01
8
150 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
  • 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Get the number of current month days 2 23
Jquery GMAP3 Hierarchy 1 24
Passport Expiry 3 44
Pass asp session variable to a js function in an asp script 6 19
In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

776 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