• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to add a scroll bar on alert box to display extremely long message

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, there
I need to display lots of data on an alert box but I found I have no way to scroll it down in order to look at the latter half part. I am wondering if there is anyone has similiar experience and any solutions.
Thanks in advance.
Lily
 
Ranch Hand
Posts: 515
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might be better off just opening a window and you controlling the size of the window.
Dale
------------------
By failing to prepare, you are preparing to fail.
Benjamin Franklin (1706 - 1790)
 
white lily
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The messge is dynamicly obtained during run-time therefore, I can not create html file for it. Can I use JSP page instead of html file ?
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes perfect use for jsp. i dont know jsp that well but i used it in my web app to give me dynamic html i only had one line of java which was to get the user name from the request. thats what i would do is use .jsp instead of .html
as long as your server supports that.
[This message has been edited by Randall Twede (edited October 22, 2001).]
 
white lily
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Dale and Randall.

I passed the long data to a hidden field and then used a javascript to open a new window to display the data. It was successful but the format of the data is a total mess. It was extremely tidy and clean when I used alert box, though. I believe that using jsp file would result in the same result.
Anybody knows why alert box is able to do this and how we can get the same thing done using window object or any other ways?
Lily
 
Randall Twede
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
maybe an applet then. i think the problem sounds like with alert box you get auto(linefeeds thrown in maybe)? in an applet you can use a ?(i forget its been a long time) which will do what you want. Im not sure but thats where i would look next.
actually with jsp you can use any java objext so you should be able to do it in jsp. better than applet maybe.
------------------
Dont blindly believe everything I say.
[This message has been edited by Randall Twede (edited October 23, 2001).]
 
Randall Twede
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
white lily,
I hate to say this but, your name does not comply with the Javaranch naming guidelines which can be found at http://www.javaranch.com/name.jsp
please register again with a valid name.
they like real or real sounding names.
 
white lily
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am sorry. I will do it next time I post a topic.
Lily
 
Randall Twede
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
im still waiting to see if anyone has a good answer for you. i feel so useless sometimes
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can write the code directly to the pop up window. It is rather easy to do. All You need to do is updat the variable SayWhat with the text you want it to say. If you need help adapting this code, just hollar.
<html>
<head>
<title>PopUpScript</title>
<script>
function PopUp(){
var ScreenWidth=window.screen.width;
var ScreenHeight=window.screen.height;
var movefromedge=0;
placementx=(ScreenWidth/2)-((400)/2);
placementy=(ScreenHeight/2)-((300+50)/2);
WinPop=window.open("About:Blank","","width=400,height=300,toolbar=0,location=0,directories=0,status=0,scrollbars=0,menubar=0,resizable=0,left="+placementx+",top="+placementy+",scre enX="+placementx+",screenY="+placementy+",");
var SayWhat = "<p><font color='blue'>This is what the windows text is</font></p>";
WinPop.document.write('<html>\n<head>\n</head>\n<body>'+SayWhat+'</body></html>');
}
</script>
</head>
<body>
<a href="javascript:PopUp()">Type One</a>
</body>
</html>
reply
    Bookmark Topic Watch Topic
  • New Topic