Solved

JSP & JavaScript...

Posted on 2003-11-18
7
570 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
ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

 
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to exclude a file using regex 5 118
'exit' is not valid keyword in java 14 152
JSONSerializer.toJSON in JSP generating error 8 75
web application structure 18 77
Data breaches are on the rise, and companies are preparing by boosting their cybersecurity budgets. According to the Cybersecurity Market Report (http://www.cybersecurityventures.com/cybersecurity-market-report), worldwide spending on cybersecurity …
As a business owner, there are many things that keep you up at night. Profit margins, employee retention, human resource protocols, whether your product or service will remain competitive. When you own or manage a technology company that operates la…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

773 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