0

Paging Component shows wrong Page. Bug ?

asked 2010-10-06 03:27:35 +0800

RFSLUX gravatar image RFSLUX
75

updated 2010-10-06 03:34:20 +0800

Hello,


yesterday we found a curious behaviour by softwaretest and i've no idea how to solve.
maybe a bug ?

I put 30 rows in a grid with paging component (pagesize 10) go to the third page (element 20-29 are shown), now i clear the grid and
fill in 20 elements. The grid shows elements 0-9 the (in fact the first page) but pageing component is on side 2 and i cannot navigate.
Every time you move to the last page and refill the grid with a smaller number of rows the issue can be reproduced.

Any idea, what's going wrong ?

Version/Browser: ZK5.04PE, IE6,7,8,FF

Zul File for testcase:

<?page title="TestCase/Paging" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="TestCase/Paging" border="normal" width="400px">
	<vbox>
		<button width="100px" label="Fill30" onClick="fill(30)" />
		<button width="100px" label="Fill20" onClick="fill(20)" />
		<grid id="tblDemo" fixedLayout="true" onCreate="self.setPaginal(pg)" pagingPosition="bottom" width="300px" height="400px"  mold="paging" > 	 
			<columns>
				<column id="tblDemoCol1" label="Number" width="280px"/>
			</columns>
			<rows></rows>
		</grid>
		<paging id="pg" autohide="true" pageSize="10" detailed="true"/>
	</vbox>
	
	<zscript language="Java"><![CDATA[
		 void fill(int nCount){
			 clearGrid(tblDemo);
			 
			 Rows rows = tblDemo.getRows();
			 
			 for (int i = 0; i<nCount; i++){
				 Row row = new Row();
		
				 Label l = new Label(Integer.toString(i));
				 row.appendChild(l);
				 rows.appendChild(row);
			 }
		 }
	 
		public void clearGrid(Grid grid){
			 Rows rows = grid.getRows();
			 List myList = rows.getChildren();
			 int y = myList.size();
			 for(int f=y-1 ; f>=0 ; f--){
				 AbstractComponent comp = (AbstractComponent)myList.get(f);
				 rows.removeChild(comp);	
			}
		}
	
	 ]]>
	</zscript>
</window>
</zk>

Best regards,
Jörg

delete flag offensive retag edit

1 Reply

Sort by » oldest newest

answered 2010-10-06 06:55:10 +0800

RyanWu gravatar image RyanWu
533 2
about.me/flyworld

i test the code you provide on the ZK Sandbox,
and post a bug on the sourceforge
The tracker
https://sourceforge.net/tracker/?func=detail&aid=3082093&group_id=152762&atid=785191

link publish delete flag offensive edit
Your reply
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

RSS

Stats

Asked: 2010-10-06 03:27:35 +0800

Seen: 237 times

Last updated: Oct 06 '10

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