Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-1800

Paging not autohide when no data in grid

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 6.5.2
    • Components
    • Java 1.6, Tomcat 6.0.33

      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.

      Below is the code to replicate the issue. When click on the "test" button, the paging suppose to hide automatically but it is still remain there and showing page 1/2. Check the attachment for screen capture. This issue only happen on version 6.5.2.

      test.zul
      <?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 }" paginal="@{pg }" mold="paging">
      			<columns>
      				<column>Test</column>
      			</columns>
      			<rows>
      				<row self="@{each='item' }" value="@{item }">
      					<label value="@{item }"/>
      				</row>
      			</rows>
      			<foot>
      				<footer><paging id="pg" pageSize="10" autohide="true"/></footer>
      			</foot>
      		</grid>
      		<button label="test" onClick="testMe()"/>
      	</window>
      </zk>
      

      We found that the problem will not occur if using EE version with the following feature turn on.

      <!-- [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>
      

            Unassigned Unassigned
            joeyjoo joeyjoo
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: