display tree using JSP

B

Beecie

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.
 
H

Heiner Kücker

Beecie wrote
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.
 
B

Beecie

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top