Solved

Navigating to the content on the same page

Posted on 2009-04-01
8
148 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
Comment Utility
<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
Comment Utility
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
Comment Utility
erm... and this comment expands on what I already said in what way?
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 220 total points
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:Kadhiravan
Comment Utility
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
Comment Utility
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
Comment Utility
I got the page scroll working fine. Thanks for your help.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
And why a "B" ?
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
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)

743 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