Re: SmallTalk Printing In ZK - not more than 50 entries are rendered

asked 2023-04-13 01:29:44 +0800

holos gravatar image holos
21 4

updated 2023-04-13 01:36:22 +0800

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.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2023-04-17 14:59:58 +0800

MDuchemin gravatar image MDuchemin
2310 1 6
ZK Team

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

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2023-04-13 01:29:44 +0800

Seen: 9 times

Last updated: Apr 17

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More