Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Popup window

Status
Not open for further replies.

greygirl

Programmer
Jun 12, 2002
34
0
0
US
Please Help!
In my java, jsp app I display the results from the database table in the results page. The column names of this table are links to show the definitions of column names. I am pasting an example table below:

Title Entry Wage Average Accountants and Auditors $13.09 $20.24 $18.49

If the user clicks "Entry Wage" I would like to open up a small pop up window (popup.jsp) which shows the one paragraph definition of the column. Then with a close button or something he can close the window and he would be still in the results screen. The definition of the column is not in the database table but I can store this in a string and pass it to this pop up page or something. Anybody - has any ideas of how to do this.
greygirl
 
Anybody! Any ideas! By the way, in my question above, the title names and the values are mistakenly in the same line. They are two different lines.
In my first jsp file I have these results with the titles displayed and the user clicks the title and the definition of the title should be displayed in a pop up window. In the results page (first jsp file) when i display the column titles, i can have <a href=&quot;titleDescription.jsp?title=average&quot;>Average</a>
But I have to open this titleDescription.jsp as a pop up window over my parent window which is calling this popup window. I also should be able to close this pop up window and I am back on my parent window.
greygirl
 

this is definitely workable...

what you need to happen is:

1 - results are displayed for user in columns
2 - each column has a title
3 - click on title, popup window is displayed
4 - popup window has short definition of title
5 - on popup window close, user returns to results page

yes?

- g
 
You right on the dot! Thanks for any ideas.
greygirl
 

here's an idea...very rough, the document.write doesn't clear the window contents if you don't close the window first before clicking another link, but the idea is there...

***
<script>

function openwin(a) {

switch(a) {
case 'cust' : x = 'heres the defintion of customer';break;
case 'custid' : x = 'heres the defintion of customerid';break;
case 'inv' : x = 'heres the defintion of invoice';break;
case 'tot' : x = 'heres the defintion of total';break;
}

win=window.open('','popup','width=300, height=200');
win.window.focus();
win.document.write(x);

}

</script>

<br><br><br>
<a href=javascript:eek:penwin('cust');>customer</a>&nbsp;&nbsp;
<a href=javascript:eek:penwin('custid');>customer id #</a>&nbsp;&nbsp;
<a href=javascript:eek:penwin('inv');>invoice #</a>&nbsp;&nbsp;
<a href=javascript:eek:penwin('tot');>total</a>&nbsp;&nbsp;
***

it definitely could use some cleaning, but maybe will help define a path for you...

- g
 
Hi g
Thanks! It worked well. Can you hang on one more minute to help me with the code to close this window. Can I have a link or a button in the pop up window which has the close function? Thanks a lot!
greygirl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top