By Duncan Mills on Dec 20, 2012
It's sometimes funny how the same question comes from several unrelated places at almost the same time. I've had just such a question from a couple of unrelated projects recently, the query being the simple one of "how big is my browser window"?
Now in many cases this is a null question. With the correct use of layout containers (and testing) you can build layouts in ADF which adapt, flow and stretch well as the user re-sizes the browser. However, there are circumstances, as was the case here, where you want more drastic changes based in the amount of space you have to play with. For example you may choose to hide a column in a table if the screen is below a certain size.
Well this is certainly possible, but of course it comes at a price. If you want to know when the browser window has been resized you have to tell the server, and that's a round trip. So to do this efficiently this is not totally trivial. However, to save you the trouble of thinking too hard, I've written a sample - it is Christmas after all and Christmas is all about giving.
The sample can be downloaded from the ADF Samples site on Java.net.
Once you have the sizing information from the client, of course it's up to you to decide what to do with it!
The sample is written in 126.96.36.199 and will work for 11.1.1.n and 11.1.2.n versions.