0

Paging not working well in 6.5.2

asked 2013-05-30 11:14:23 +0800

joeyjoo gravatar image joeyjoo
63 1

I have a grid and I am setting the mold to "paging" and pageSize to 10. The page load around 13 record using AnnotateDataBinder and the paging component show correctly. However, when the data reset to empty, the grid redraw correctly but the paging still showing in the page with incorrect information.

This issue only happen in ZK ver 6.5.2, it is working fine in ZK ver 6.5.1.1. Is anyone facing the same issue ? Any solution to this ?

Here is the example code to re-produce the problem.

<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" root="./rootCP"?>

<zk>
    <window id="rootCP">
        <zscript><![CDATA[
            List data = new ArrayList();
            data.add("10");
            data.add("11");
            data.add("12");
            data.add("13");
            data.add("14");
            data.add("15");
            data.add("16");
            data.add("17");
            data.add("18");
            data.add("19");
            data.add("20");
            data.add("21");
            data.add("22");

            public void testMe() {
                data.clear();
                ((DataBinder)rootCP.getAttribute("binder")).loadComponent(test);
            }
        ]]>
        </zscript>
        <grid id="test" model="@{data }" mold="paging" pageSize="10">
            <columns>
                <column>Test</column>
            </columns>
            <rows>
                <row self="@{each='item' }" value="@{item }">
                    <label value="@{item }"/>
                </row>
            </rows>
            <foot>
                <footer>xxxx</footer>
            </foot>
        </grid>
        <button label="test" onClick="testMe()"/>
    </window>
</zk>
delete flag offensive retag edit

2 Answers

Sort by » oldest newest most voted
0

answered 2013-05-30 11:20:34 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

I have added your demo code in zk Fiddle Pagination can you please explain what the issue you are facing?

link publish delete flag offensive edit

Comments

If you click on the "test" button in the example, the list will be clear and the paging component suppose to hide because there are no longer contains any data in the model. However, in ZK 6.5.2, the paging component still exist and it still showing page 1/2 which is wrong.

joeyjoo ( 2013-05-30 11:29:42 +0800 )edit

Yes its working fine see the link i added in my answer

sjoshi ( 2013-05-30 11:42:52 +0800 )edit

Thanks. Ya, it did work in Fiddle. I will try to verify what could be wrong on my environment. Will update again tomorrow.

joeyjoo ( 2013-05-30 11:50:53 +0800 )edit

I have verified. It was working in Fiddle but not working on the community version that I downloaded.

joeyjoo ( 2013-05-31 03:44:00 +0800 )edit
0

answered 2013-05-31 03:48:19 +0800

joeyjoo gravatar image joeyjoo
63 1

updated 2013-05-31 04:20:59 +0800

It seem like it's working in Fiddle but not when tested locally. See this screen captured

We found that it is caused by the setting below in zk.xml. When this feature turned off (false); which is the default, the issue reported will occur.

<!-- [ZK EE] 
Turn on if you want to enable the render-on-demand feature for grid. 
It improves the performance for huge grid. 
Default: false 
-->

<library-property>
   <name>org.zkoss.zul.grid.rod</name>
   <value>true</value>
</library-property>
link publish delete flag offensive edit

Comments

Hmm if this is cause of the issue then you can report the issue

sjoshi ( 2013-05-31 05:24:38 +0800 )edit

reported as an issue at http://tracker.zkoss.org/browse/ZK-1800

joeyjoo ( 2013-05-31 07:15:22 +0800 )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

Follow
2 followers

RSS

Stats

Asked: 2013-05-30 11:14:23 +0800

Seen: 26 times

Last updated: May 31 '13

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