Simplica

ProductsLearnPurchaseSupportDemoDownload
  [Search] Search   [Recent Topics] Recent Topics  
How to set window-location programmatically?
Forum Index -> Window
Author Message
sn7400


Joined: 04/09/2008 14:35:52
Messages: 11
Offline

Hello,
I went through the doc-examples to understand how to work with the window-component and
I recognized, that the window appears every time on the same location, doesn't matter wich
values to set for "top" or "left".

In the pdf you can read "You can define Window’s opening size by specifying height and width
attributes, and you can determine the location where it should open by specifying top and
left-hand coordinates in the div." That means, there is a way to set the exact location.

In my future application the user should be able to open windows, change their size and location.
When the user clicks on the close-button [X] an onclose-event is fired and this method reads
it's window's size (width and height) and it's location (top and left) and then stored in an
valueHolderBean so that, when opening the same window again, it should appears on the same location
with same size. So I modfied the window-basic.jsp like this:

an the corresponding backing bean (only modification here's showing), that has a request-scope:

The ValueHolder-bean with session-scope:

What happens:
The small window appears. If you change the size and close it, the values are stored in the
variables "width", "height", "top" and "left" of the ValueHolder-bean. The next time the window
appears with the last size (that is working!) but not on the last location. It seams that
the values "top" and "left" are totally ignored. Even if I set these values dirct in the jsp:
position="absolute" top="10px" left="10px"
or
position="absolute" top="300px" left="200px"
the windows appears at the same location. I tried to surround the window in an <e:div> tag
but without success.
What am I doing wrong?

Greetings, Axel
ldanut
Simplica Team

Joined: 05/01/2008 08:11:31
Messages: 1
Offline

This was an internal bug to window component that we fixed.
We have an observation: onOpen and onClose events are fired after the window open and close and make a separate request to the server.
Because of this initially the window will apear in a position and after onopen request comes back it will move the window to your position.
A better solution will be to use value bindings for top, left, width and height so they are used exactly when the windows open.

Best regards,
Simplica Support Team.
sn7400


Joined: 04/09/2008 14:35:52
Messages: 11
Offline

Hello ldanut,
thanks for your reply but your suggested solution didn't work. I can set separate value bindings for each attribute width, height, top and left

width="#{basicWindow.width}"
height="#{ basicWindow.height}"
top="#{ basicWindow.top}"
left="#{ basicWindow.left}"

or set the values direct

width="400"
height="400"
top="400"
left="400"

the window pops up always on the same location.

In which version is the bug fixed?

Greetings, Axel
 
Forum Index -> Window
Go to:   
Powered by JForum 2.1.7 © JForum Team
Home   |  News   |  Contact   |  About   |  License   |  Privacy   |  Documentation
Copyright © 2012 Simplica Corporation. All rights reserved.