Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • 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
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

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: 67699
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: 67699
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.
 
We're all out of roofs. But we still have tiny ads:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic