-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I followed the instructions in
https://www.zkoss.org/wiki/Small_Talks/2014/December/Printing_In_ZK (Printing In ZK)
and could successfully print the content of any container in my zul.
Then I extended the solution and used a zul with mvvm to print any kind of data. Again, this worked perfectly well.
But then I noticed, that if I use a listbox or a grid it only renders exactly 50 entries (!) before stopping rendering of "content" but just renders empty borders.
What is the reason? Why is 50 a magic number???
If I open the "print-zul" directly it renders all elements. More than 50.
Note: the solution described in the SmallTalk uses a hidden iframe to render the output of a zul file.
The hiden iframe is set as
<iframe id="zk_printframe" name="zk_printframe" style="width:0;height:0;border:0;position:fixed;"/>
Side note: I added the same listbox twice. And it rendered exactly the same 50 entries twice and again stopped rendering then.
Hello there,
You are most likely encountering the ROD "render on demand" limit. There are multiple ROD versions in ZK (EE / CE) and they work slightly differently depending on your framework version, but the main idea is that tabular components (grid, listbox, tree) main contain large datasets.
In order to improve performance, ZK will automatically limit the amount of the rows rendered by the client. Once the user scrolls down in the grid, the following rows are rendered when they get "into view".
If your grid contains "a reasonable quantity of lines" to be rendered during the initial load of the component, you can simply disable ROD for that component.
You can use the following inside the grid component to disable ROD:
<custom-attributes org.zkoss.zul.grid.rod="true" scope="page"/>
See here for more info: https://www.zkoss.org/wiki/ZKDeveloper'sReference/PerformanceTips/Listbox,GridandTreeforHugeData/TurnonRenderon_Demand#Grid
Asked: 2023-04-13 01:29:44 +0800
Seen: 10 times
Last updated: Apr 17