0

Default Button

asked 2014-10-27 15:40:20 +0800

JBlaha gravatar image JBlaha flag of Germany
1

How can I define a default button? I.e. a button that reacts to the user pressing "Enter" somewhere on the page.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-10-27 16:18:11 +0800

gargamel25 gravatar image gargamel25
41 2

updated 2014-10-27 16:18:40 +0800

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

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

Follow
1 follower

RSS

Stats

Asked: 2014-10-27 15:40:20 +0800

Seen: 18 times

Last updated: Oct 27 '14

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