[Help]use Enter on listbox

asked 2014-07-21 02:18:52 +0800

unitcell gravatar image unitcell
28 4

Hi all,

we know press TAB key to change input field to next field on listbox, how do I change to use Enter to replace the TAB ?


delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-07-21 07:46:04 +0800

cyiannoulis gravatar image cyiannoulis
1201 10

You have to check the keyboard event manually. First, declare the CR event inside your zul page:

<textbox value="@bind(cellValue)" 
onOK="@command('edit-next-field', component=self)" inplace="true" />

Then in your view model you have to implement the command to handle the event:

public void onEditNextField(@BindingParam("component") Component component) {
  Component sibling = component.getNextSibling();

  if (sibling instanceof Textbox) {
    Textbox tb = (Textbox)sibling;
  else if (sibling == null) {
    Component parent = component.getParent();
    Component nextRow = parent.getNextSibling();
    if (nextRow instanceof Row) {
        Textbox tb = (Textbox)nextRow.getFirstChild();


Hope that helps


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

1 follower



Asked: 2014-07-21 02:18:52 +0800

Seen: 10 times

Last updated: Jul 21 '14

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