Solved

JSP & JavaScript...

Posted on 2003-11-18
7
582 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
Arrow Electronics was searching for a KVM  (Keyboard/Video/Mouse) switch that could display on one single monitor the current status of all units being tested on the rack.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

756 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