Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

display tree using JSP

Thread view: 
Beecie - 14 Dec 2005 16:41 GMT
Hi,

I'm using struts for my web application. I have a tree structure
displayed by using JSP. I have implemeted the functions that can expand
and clap the tree. The only problem is that the tree is big. If I
scroll down a page to the middle and expend a node there, how can I
stay there after the node is expended? I know for html page, you can
use <a name="xxx"> and append #xxx to the end of the URL. How can I
implement that using JSP and struts? In other word how can I make a JSP
page remember the scroll position of a frame?

Thank you very much.

B.
Heiner Kücker - 14 Dec 2005 18:21 GMT
> how can I
> stay there after the node is expended?

For this task is using JavaScript useful.

 <script language="JavaScript" type="text/javascript">
 <!--
   document.forms[0].elements[' *selectedNODE* '].focus();
   window.scrollTo( elements[' *selectedNODE* '].offsetLeft , elements['
*selectedNODE* '].offsetTop );
 // -->
</script>

The expression

  elements[' *selectedNODE* ']

means your expanded node.

I dont know, whether a struts tag is instantly useful for
this task or not.

Signature

Heiner
www.heinerkuecker.de

Beecie - 14 Dec 2005 21:01 GMT
Heiner:

Thank you very much for your reply. Would you please let me know where
do you call this javascript? at the time the document is load? Would
you please be a little bit specific if you could?

I really appreciate your help and info.

B.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.