-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello Everyone,
I need some help regarding screen/desktop resolution.
in my project currently i am dealing with two main zuls,which are working correctly just problem is its design/view in browser
i am using linux os,so when i run this project on Windows then its work fine but problem regarding width of some textboxes,intboxes componenets.
after login i used in next zul borderlayout,i shown the menus to left side and after clicking on one of menu the respected zul will be opened in
center component of layout..for that i used iframe.
so i tried to chnage ifame as well as screen/desktop resollution by referring following threads from Forum:
http://www.zkoss.org/forum/listComment/7367
i did like follwing :
used the onclientinfoevent for window (as it works only for root componenet) in that method as :
void onClientInfo(ClientInfoEvent event) { int dskHeight,dskWidth,scrHeight,scrWidth; dskHeight = event.getDesktopHeight(); dskWidth = event.getDesktopWidth(); scrHeight = event.getScreenHeight(); scrWidth = event.getScreenWidth(); System.out.println("^^^^^^^^^ SCREEN HEIGHT IS : "+" "+scrHeight+" SCREEN WIDTH IS "+" "+scrWidth); System.out.println("******* Desktop HEIGHT IS : "+" "+dskHeight+" Desktop WIDTH IS "+" "+dskWidth); center_frame.setHeight(""+dskHeight);//////where center_frame is id of iframe i used to display selected zul center_frame.setWidth(""+dskWidth); }
so will anyone please help me how do i solve this issue while different browsers?
Many Thanks in advance
onClientInfo(ClientInfoEvent event) works per zk documentation ONLY on a root component. In our case in the outerWindow component.
We store these sizes params in a so called UserWorkspace which is created as spring bean scope="session" for every logged in user.
If we need such sizes for calculating the high of a borderlayout or listbox we get them from this UserWorkSpace class.
It's not easy to find out what goes wrong if you cut pieces from a well running application and modify them or put it into other context.
The best way is to checkout zksample2 new into an other place and debug the things what are interesting for you.
best
Stephan
Hello Sir terrytornado,
will you please tell me how you did following?
it will be better if you will provide me some detailed code please.
public void onClientInfo(Ecent event){
UserWorkspace().getInstance().setDesktopHeight( evt.getDesktopHeight() );
UserWorkspace().getInstance().setDesktopWidth( evt.getDesktopWidth() );
}
Asked: 2013-01-18 07:00:08 +0800
Seen: 63 times
Last updated: Jan 18 '13