0

Listbox: keyboard events to select listitems

asked 2011-02-10 02:42:07 +0800

dis gravatar image dis flag of Switzerland
140 4

Hi

I want to implement a simple list with some options to choose from.

The listbox control can be used. However, the listbox control does not support direct item selection with keyboard events.

This feature is well supported by the HTML <select> control.

Is there a way to do that with ZK Listbox?

Thank you
Dieter

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2011-02-13 19:19:16 +0800

samchuang gravatar image samchuang
4084 4

updated 2011-02-13 19:19:29 +0800

Hi

I tested on listbox with mold="select", after user click drop drop button, user can use keyboard to select listietm

	<listbox rows="1" mold="select">
		<listitem label="Inbox"/>
		<listitem label="Received"/>
		<listitem label="Draft"/>
	</listbox>		

link publish delete flag offensive edit

answered 2011-02-14 02:08:58 +0800

dis gravatar image dis flag of Switzerland
140 4

Thank you very much

Your solution works perfectly for a list where one item can be selected.

We have a list where multiple items can be selected.

<listbox rows="5" mold="select" multiple="true">
...


From a functional point of view it works. However, there is a minor usability issue: when I select an item with the mouse, the list scrolls somewhere else and the selected item is not visible in the visible list area.

Code snippet: click on 'Draft' in the list and the list scrolls to the last list items:

<listbox rows="5" mold="select" multiple="true">
		<listitem label="Inbox"/>
		<listitem label="Received"/>
		<listitem label="Draft"/>
		<listitem label="A"/>
		<listitem label="B"/>
		<listitem label="C"/>
		<listitem label="D"/>
		<listitem label="E"/>
		<listitem label="F"/>
		<listitem label="G"/>
		<listitem label="H"/>
		<listitem label="I"/>
		<listitem label="J"/>
		<listitem label="K"/>
	</listbox>

Regards
Dieter

link publish delete flag offensive edit

answered 2011-02-14 05:15:08 +0800

samchuang gravatar image samchuang
4084 4

Hi

It does look very strange, Could you post bug here ?

link publish delete flag offensive edit

answered 2011-03-13 05:24:00 +0800

prime2005 gravatar image prime2005
18

I'm trying to create a 'select multiple' listbox but having the same problem. I remove the select mold as a workaround. is the bug posted?

link publish delete flag offensive edit

answered 2011-03-14 02:24:21 +0800

dis gravatar image dis flag of Switzerland
140 4

Hi,

This issue is solved in ZK 5.0.6

- Dieter

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-02-10 02:42:07 +0800

Seen: 578 times

Last updated: Mar 14 '11

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