-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello
I'm attempting to get the height of the browser so I can adjust the number of records in a list.
I've attempted this:
<listbox model="@load(vm.customers)" onClientInfo="@command('onClientInfo',evt=event)" height="100%"> .... </listbox>
And on the view model:
@Command
public void onClientInfo(@ContextParam(ContextType.TRIGGER_EVENT) ClientInfoEvent evt) {
....
}
However it did not seem to call my operation when the page loaded.
Any help gratefully received.
Kind regards
Pete
onClientInfo works ONLY on the outer most window component.
zul:
<window width="100%" height="100%"
onClientInfo="@command('updateClientInfo', width=event.desktopWidth, height=event.desktopHeight, orientation=event.orientation)" >
<listbox model="@load(vm.customers)" . . .
java:
@Command()
public void updateClientInfo(@BindingParam("orientation") String _orientation,
@BindingParam("width") int _width, @BindingParam("height") int _height) {
. . .
best Stephan
PS: Complete code about the responsive stuff (i.e. calculate pageSize by browser resize) comes end of month with the ZKBoost documentation.
I am not sure if i understand your problem correctly. You need a way to determine the "pageSize" attribute depending on the height of your browser? Then why don't you use the "autopaging" property? It works very nice and recalculates automatically the visible number of rows on each page. The only drawback i 've came accross is that the rows should have a fixed height (or else zk will have problems trying to recalculate the page size). This can be done easily declaring a style like this:
.z-listbox-autopaging .z-listcell-cnt {
height: 60px;
overflow: hidden;
}
with a listbox declaration like this:
<listbox mold="paging" autopaging="true" ... >
Hope that helps
Costas
Asked: 2014-10-05 22:08:34 +0800
Seen: 50 times
Last updated: Oct 07 '14
How to stop combining commands in an ajax call ?
zk.auSend not called on composer
Font Awesome Problem with IE8 when security option "font download" is disabled
Send a client event with JSON data
How to capture the Browser Window Resize/Size Event
Toggled Popup - Close ONLY on toggling, not on focus lost
Verify existence -Verificar existencia DNI
Sorry I cannot use autopaging as the data set being read is very large and I need to read a page at a time from the database - server side pagination as opposed to client side. I believe autopaging is client side in that it assumes a full data set and then pages on that in memory.
PeteMorgan ( 2014-10-06 09:09:57 +0800 )edit