-
FEATURED COMPONENTS
First time here? Check out the FAQ!
How can I define a default button? I.e. a button that reacts to the user pressing "Enter" somewhere on the page.
You can use onOK
<window mode="overlapped" position="top,center"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('lvm') @init('test.LoginViewModel')"
form="@id('f') @load(lvm.form) @save(lvm.form, before='submit')"
onOK="@command('submit')"
sclass="box-wnd login-dlg">
<textbox id="tbxUsername" name="j_username" value="@bind(f.username)"/>
<button id="btnLogin" label="Login" onClick="@command('submit')" />
<button id="btnCancel" label="Cancel" onClick="@command('cancel')" /></window>
This way if you press enter or click the login button the same command= submit will be executef
Asked: 2014-10-27 15:40:20 +0800
Seen: 18 times
Last updated: Oct 27 '14