0

Listbox PgUp,PgDn seems not work

asked 2011-10-05 10:34:18 +0800

ggrimoldi gravatar image ggrimoldi
74 1

I have a listbox with mold="paging".
I set pageSize="10" and have a model with 50 records in, so I see 5 pages.
The listbox have focus, so I can scroll with arrow keys on active page.
But when I press PgUp or PgDn on an active page I don't have a page change as I'm expecting.
PgUp works as Home key (goes at first record of active page) and PgDn works as End key (last record on active page).

I'm usign ZK 5.0.8.

Is this a bug or am I missing something?

Thanks for any answer.

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2011-10-05 11:45:57 +0800

cyiannoulis gravatar image cyiannoulis
1201 10

This is the default behavior of Listbox. Unfortunately the Listbox component will not let you map PageUp/PageDn using the "ctrlkeys" property. I have done something similar using the Grid component.

Hope that helps.

/costas

link publish delete flag offensive edit

answered 2011-10-05 13:46:14 +0800

ggrimoldi gravatar image ggrimoldi
74 1

But in zk demo the sample "keystroke commands" for listbox tells pgdn and pgup go to the next/previous page if any. So I expect this works. What is wrong? The demo sample or the listbox behaviour? Thanks for any answer.

link publish delete flag offensive edit

answered 2011-10-06 01:49:43 +0800

cyiannoulis gravatar image cyiannoulis
1201 10

Your are right about the demo. Maybe the zk team forgot to change the explanation or maybe this was a functionality provided in an older version.

/costas

link publish delete flag offensive edit

answered 2011-10-09 00:14:05 +0800

benbai gravatar image benbai
2228 6
http://www.zkoss.org

updated 2011-10-10 20:51:25 +0800

Hi ggrimoldi,

Listbox currently not support paging with PageUp/PageDown,
you may post a feature request here,
and try the work around below:

ZKFiddle-Link

index.zul
<zk> 
<listbox mold="paging" pageSize="2" xmlns:w="client">
<attribute w:name="_doKeyDown">
function (h) {
if (h.data.keyCode == 33) {
jq(this.$n('pgib')).find('.z-paging-prev').click();
h.stop();
} else if (h.data.keyCode == 34) {
jq(this.$n('pgib')).find('.z-paging-next').click();
h.stop();
} else
this.$_doKeyDown(h);
}
</attribute>
<listitem><listcell label="cell one" /></listitem>
<listitem><listcell label="cell two" /></listitem>
<listitem><listcell label="cell three" /></listitem>
<listitem><listcell label="cell four" /></listitem>
<listitem><listcell label="cell five" /></listitem>
</listbox>
</zk>

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: 2011-10-05 10:34:18 +0800

Seen: 151 times

Last updated: Oct 09 '11

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