Solved

JSP & JavaScript...

Posted on 2003-11-18
7
564 Views
Last Modified: 2006-11-17
My question is, is there a way to take a label and give it a js onClick() meth and have that control a JSP action in loading a page in the current one but without needing to refresh the page or would that require loading a few layers, making the one i want visible, visible, and the others not...?
And if there is a way to do this please let me know, thanks.

thank you for the help

- nc
0
Comment
Question by:B000GT
  • 3
  • 3
7 Comments
 
LVL 6

Expert Comment

by:jarasa
ID: 9777423
Hi Booogt.

I'm sorry but I really don't get what you want to do, anyway if you have to do any process at the server side you have to refresh the page.

You can make a text have a OnClick() this way:
<a href=# OnClick()="javascript:whatever()">My Text</a>

If you could be more specific on your needs, maybe I'll be able to help you better.

Have Fun
Javier
0
 
LVL 1

Author Comment

by:B000GT
ID: 9779345
ok well the idea here is to remove the new page stuff
<label name="band_info" onClick(<%! pageToLoad="content.jsp" %>)>Home</label>

now when i click on this i want a target to change on the click without refreshing the page...
does that help to explain what i want a little better?

thanks

- nc
0
 
LVL 6

Expert Comment

by:jarasa
ID: 9779433
I think it doesn't.

You want to open a new page fron that label? I mean when you click on the label you want a new page to be opened in a difernet window?

Sorry but I still don't get your pourpuses.

Javier
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:B000GT
ID: 9779762
lol
ok here goes again

i want to set a target in the middle of the page: X
---------------------------------
|      A    B    C   D             |
|                                      |
|                                      |
|                  X                  |
|                                      |
|                                      |
---------------------------------
A, B, C, & D are all labels...if i click on A or B or C or D i want X to change without refreshing the page, JUST the place that X is at.

let me know if i need to clearify any more
thank you for your help

- nc
0
 

Expert Comment

by:webhsu
ID: 9781148
Have you tried using frames?
give the frames id's, and have only that frame with X in it refresh.
0
 
LVL 1

Author Comment

by:B000GT
ID: 9783485
the point is to change the content without having to click the back button 5 times to leave the whole page, click it once and you go to the previous page, plus it looks nice, if i have to i'll just have the whole page show because i import most of the pages so they all are compiled and in the cache which reduces the load time

if there is no way to do it then i'll either make it or just have the page load

thanks for all the help

- nc
0
 
LVL 6

Accepted Solution

by:
jarasa earned 325 total points
ID: 9785456
Hi there.
If you already have the data you want to put on the X point you should use Hidden <Div> and when you click on the label just show the appropiated <DIV>, something like this:

<div id="XpoinA" style="z-index:1; position:absolute; left:10px; width:754px; top:30px; height:369px; visibility:hidden">
Your data for when you click on A
</div>
<div id="XpoinB" style="z-index:1; position:absolute; left:10px; width:754px; top:30px; height:369px; visibility:hidden">
Your data for when you click on B
</div>
<div id="XpoinC" style="z-index:1; position:absolute; left:10px; width:754px; top:30px; height:369px; visibility:hidden">
Your data for when you click on C
</div>

<label name="Alabel" onClick="JavaScript:document.all.XpoinA.style.visibility= 'visible';">A</label>
<label name="Blabel" onClick="JavaScript:document.all.XpoinB.style.visibility= 'visible';">B</label>
<label name="Clabel" onClick="JavaScript:document.all.XpoinC.style.visibility= 'visible';">C</label>

You should probably have to hide the other 2 <div> each time you make one visible in order to don't have unexpected data on the page.

Hope it helps.

If you don't have all the Data you want to show you must use Frames and refresh it calling the server with the Target option.

Javier

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Run the project 5 87
password protect pdf 11 74
difference between member and local variables. 29 126
reflection example 3 92
In 2017, ransomware will become so virulent and widespread that if you aren’t a victim yourself, you will know someone who is.
With the rapid rise in mobile usage, mobile devices are here to stay and have become an integral part of doing business. Here are 9 great apps for your BYOD environment.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

895 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

11 Experts available now in Live!

Get 1:1 Help Now