-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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 ?
Thanx.
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:
@Command("edit-next-field")
public void onEditNextField(@BindingParam("component") Component component) {
Component sibling = component.getNextSibling();
if (sibling instanceof Textbox) {
Textbox tb = (Textbox)sibling;
tb.setFocus(true);
}
else if (sibling == null) {
Component parent = component.getParent();
Component nextRow = parent.getNextSibling();
if (nextRow instanceof Row) {
Textbox tb = (Textbox)nextRow.getFirstChild();
tb.setFocus(true);
}
}
}
Hope that helps
Costas
Asked: 2014-07-21 02:18:52 +0800
Seen: 10 times
Last updated: Jul 21 '14
wrong valueException come in front of modal popup [closed]
Use parameters in a conditional @command
Problems with multiple press and onCtrlKey
MVVM @save on the fly [closed]
Unable to activate destroyed desktop
org.zkoss.zk.ui.UiException: java.lang.ClassNotFoundException
How to put a image or Letter over image on a specific XY Coordinate