• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Setting window size on load

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a jsp page (lets call it jsp1) which I submit and the form action redirects to a new jsp page ((lets call it jsp2)

JSP1:


Now when jsp2 loads I want it to be in a smaller window size, lets say width=500, height=500.

But as the new window (jsp2) is launched as a result of a form action I am not able to control the dimensions.
Another approach I tried out was calling window.resizeTo() on the onload event for jsp2 page. But there is problem. What happens is that the jsp2 window loads in default size and after a delay of 2-3 seconds it shrinks to the size I have set. Does'nt look good.

Please help out with this problem.
Thanks in advance.
 
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use window.open() to create a new window the size you want.
 
Praveen Sharma
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
not sure if I can do that as this new jsp (jsp2) is a result of a form submit.
Is there any other way ?
 
Bear Bibeault
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well first of all, do you really think that it would be acceptable for you to resize the user's browser just because they visit your page? I know personally, I'd never go there again. Please read this for more information.

not sure if I can do that as this new jsp (jsp2) is a result of a form submit.


You can target the form submission to the new window.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic